fixes in integration tests, run fakebank with ram limit

This commit is contained in:
Florian Dold 2022-01-24 20:34:29 +01:00
parent 2f291847b0
commit ee492b2552
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
3 changed files with 8 additions and 6 deletions

View File

@ -67,6 +67,7 @@ import {
getRandomBytes, getRandomBytes,
hash, hash,
stringToBytes, stringToBytes,
j2s,
} from "@gnu-taler/taler-util"; } from "@gnu-taler/taler-util";
import { CoinConfig } from "./denomStructures.js"; import { CoinConfig } from "./denomStructures.js";
import { LibeufinNexusApi, LibeufinSandboxApi } from "./libeufin-apis.js"; import { LibeufinNexusApi, LibeufinSandboxApi } from "./libeufin-apis.js";
@ -319,7 +320,7 @@ export class GlobalTestState {
console.log(`could not start process (${command})`, err); console.log(`could not start process (${command})`, err);
}); });
proc.on("exit", (code, signal) => { proc.on("exit", (code, signal) => {
console.log(`process ${logName} exited`); console.log(`process ${logName} exited ${j2s({ code, signal })}`);
}); });
const stderrLogFileName = this.testDir + `/${logName}-stderr.log`; const stderrLogFileName = this.testDir + `/${logName}-stderr.log`;
const stderrLog = fs.createWriteStream(stderrLogFileName, { const stderrLog = fs.createWriteStream(stderrLogFileName, {
@ -454,7 +455,7 @@ export async function pingProc(
//console.log(e); //console.log(e);
await delayMs(1000); await delayMs(1000);
} }
if (!proc || proc.proc.exitCode !== null) { if (!proc || proc.proc.exitCode != null || proc.proc.signalCode != null) {
throw Error(`service process ${serviceName} stopped unexpectedly`); throw Error(`service process ${serviceName} stopped unexpectedly`);
} }
} }
@ -1044,6 +1045,7 @@ export class FakeBankService {
setTalerPaths(config, gc.testDir + "/talerhome"); setTalerPaths(config, gc.testDir + "/talerhome");
config.setString("taler", "currency", bc.currency); config.setString("taler", "currency", bc.currency);
config.setString("bank", "http_port", `${bc.httpPort}`); config.setString("bank", "http_port", `${bc.httpPort}`);
config.setString("bank", "ram_limit", `${1024}`);
const cfgFilename = gc.testDir + "/bank.conf"; const cfgFilename = gc.testDir + "/bank.conf";
config.write(cfgFilename); config.write(cfgFilename);
return new FakeBankService(gc, bc, cfgFilename); return new FakeBankService(gc, bc, cfgFilename);

View File

@ -33,7 +33,7 @@ import { URL } from "@gnu-taler/taler-util";
/** /**
* Run test for basic, bank-integrated withdrawal. * Run test for basic, bank-integrated withdrawal.
*/ */
export async function runTestWithdrawalFakebankTest(t: GlobalTestState) { export async function runWithdrawalFakebankTest(t: GlobalTestState) {
// Set up test environment // Set up test environment
const db = await setupDb(t); const db = await setupDb(t);
@ -93,4 +93,4 @@ export async function runTestWithdrawalFakebankTest(t: GlobalTestState) {
await t.shutdown(); await t.shutdown();
} }
runTestWithdrawalFakebankTest.suites = ["wallet"]; runWithdrawalFakebankTest.suites = ["wallet"];

View File

@ -87,7 +87,7 @@ import { runPaymentZeroTest } from "./test-payment-zero.js";
import { runMerchantSpecPublicOrdersTest } from "./test-merchant-spec-public-orders.js"; import { runMerchantSpecPublicOrdersTest } from "./test-merchant-spec-public-orders.js";
import { runExchangeTimetravelTest } from "./test-exchange-timetravel.js"; import { runExchangeTimetravelTest } from "./test-exchange-timetravel.js";
import { runDenomUnofferedTest } from "./test-denom-unoffered.js"; import { runDenomUnofferedTest } from "./test-denom-unoffered.js";
import { runTestWithdrawalFakebankTest } from "./test-withdrawal-fakebank.js"; import { runWithdrawalFakebankTest } from "./test-withdrawal-fakebank.js";
/** /**
* Test runner. * Test runner.
@ -155,7 +155,7 @@ const allTests: TestMainFunction[] = [
runRefundTest, runRefundTest,
runRevocationTest, runRevocationTest,
runTestWithdrawalManualTest, runTestWithdrawalManualTest,
runTestWithdrawalFakebankTest, runWithdrawalFakebankTest,
runTimetravelAutorefreshTest, runTimetravelAutorefreshTest,
runTimetravelWithdrawTest, runTimetravelWithdrawTest,
runTippingTest, runTippingTest,