commit 4098ec2565f57055f57407f1d9a8872d7823e553
parent 4523493621a268b6506ae1a37d45986af9518be2
Author: Florian Dold <florian@dold.me>
Date: Fri, 14 Nov 2025 19:25:41 +0100
harness: start components sequentially
We tried to be smart by parallelizing the startup of
merchant/exchange/bank. However, this led to problems where the
merchant sees the keys response of a partially initialized exchange
(with e.g. wire fees still missing).
Diffstat:
1 file changed, 13 insertions(+), 22 deletions(-)
diff --git a/packages/taler-harness/src/harness/environments.ts b/packages/taler-harness/src/harness/environments.ts
@@ -275,18 +275,16 @@ export async function useSharedTestkudosEnvironment(t: GlobalTestState) {
await merchant.dbinit();
}
- const bankStart = async () => {
- await bank.start();
- await bank.pingUntilAvailable();
- };
+ await bank.start();
- const exchangeStart = async () => {
- await exchange.start({
- skipDbinit: true,
- skipKeyup: prevSetupDone,
- });
- await exchange.pingUntilAvailable();
- };
+ // We *must* wait for the exchange to be started.
+ // Otherwise the merchant might be able to see
+ // partial /keys (e.g. with missing wire fees),
+ // leading to flaky tests.
+ await exchange.start({
+ skipDbinit: true,
+ skipKeyup: prevSetupDone,
+ });
const merchStart = async () => {
await merchant.start({
@@ -331,18 +329,11 @@ export async function useSharedTestkudosEnvironment(t: GlobalTestState) {
return { merchantAdminAccessToken };
};
- await bankStart();
-
- const res = await Promise.all([
- exchangeStart(),
- merchStart(),
- undefined,
- walletStartProm,
- ]);
+ const res = await Promise.all([merchStart(), walletStartProm]);
- const merchantAdminAccessToken = res[1].merchantAdminAccessToken;
- const walletClient = res[3].walletClient;
- const walletService = res[3].walletService;
+ const merchantAdminAccessToken = res[0].merchantAdminAccessToken;
+ const walletClient = res[1].walletClient;
+ const walletService = res[1].walletService;
fs.writeFileSync(sharedDir + "/setup-done", "OK");