diff options
Diffstat (limited to 'packages/taler-harness/src/harness/harness.ts')
-rw-r--r-- | packages/taler-harness/src/harness/harness.ts | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts index 0a898414d..8b74c9e9f 100644 --- a/packages/taler-harness/src/harness/harness.ts +++ b/packages/taler-harness/src/harness/harness.ts @@ -970,6 +970,19 @@ export class ExchangeService implements ExchangeServiceInterface { ); } + async runAggregatorOnceWithTimetravel(opts: { + timetravelMicroseconds: number; + }) { + let timetravelArgArr = []; + timetravelArgArr.push(`--timetravel=${opts.timetravelMicroseconds}`); + await runCommand( + this.globalState, + `exchange-${this.name}-aggregator-once`, + "taler-exchange-aggregator", + [...timetravelArgArr, "-c", this.configFilename, "-t"], + ); + } + async runAggregatorOnce() { try { await runCommand( @@ -1147,6 +1160,9 @@ export class ExchangeService implements ExchangeServiceInterface { exchangeHttpProc: ProcessWrapper | undefined; exchangeWirewatchProc: ProcessWrapper | undefined; + exchangeTransferProc: ProcessWrapper | undefined; + exchangeAggregatorProc: ProcessWrapper | undefined; + helperCryptoRsaProc: ProcessWrapper | undefined; helperCryptoEddsaProc: ProcessWrapper | undefined; helperCryptoCsProc: ProcessWrapper | undefined; @@ -1200,6 +1216,18 @@ export class ExchangeService implements ExchangeServiceInterface { await wirewatch.wait(); this.exchangeWirewatchProc = undefined; } + const aggregatorProc = this.exchangeAggregatorProc; + if (aggregatorProc) { + aggregatorProc.proc.kill("SIGTERM"); + await aggregatorProc.wait(); + this.exchangeAggregatorProc = undefined; + } + const transferProc = this.exchangeTransferProc; + if (transferProc) { + transferProc.proc.kill("SIGTERM"); + await transferProc.wait(); + this.exchangeTransferProc = undefined; + } const httpd = this.exchangeHttpProc; if (httpd) { httpd.proc.kill("SIGTERM"); @@ -1369,6 +1397,22 @@ export class ExchangeService implements ExchangeServiceInterface { ); } + private internalCreateAggregatorProc() { + this.exchangeAggregatorProc = this.globalState.spawnService( + "taler-exchange-aggregator", + ["-c", this.configFilename, ...this.timetravelArgArr], + `exchange-aggregator-${this.name}`, + ); + } + + private internalCreateTransferProc() { + this.exchangeTransferProc = this.globalState.spawnService( + "taler-exchange-transfer", + ["-c", this.configFilename, ...this.timetravelArgArr], + `exchange-transfer-${this.name}`, + ); + } + async start(): Promise<void> { if (this.isRunning()) { throw Error("exchange is already running"); @@ -1398,6 +1442,8 @@ export class ExchangeService implements ExchangeServiceInterface { ); this.internalCreateWirewatchProc(); + this.internalCreateTransferProc(); + this.internalCreateAggregatorProc(); this.exchangeHttpProc = this.globalState.spawnService( "taler-exchange-httpd", @@ -2062,7 +2108,7 @@ export class WalletService { [ "--wallet-db", dbPath, - "-LDEBUG", // FIXME: Make this configurable? + "-LTRACE", // FIXME: Make this configurable? "--no-throttle", // FIXME: Optionally do throttling for some tests? "advanced", "serve", |