From b24910bccf3e1ee6a85b5ac1ff32fbf525dcfa81 Mon Sep 17 00:00:00 2001 From: eljamm Date: Fri, 30 May 2025 10:00:41 +0200 Subject: [PATCH] tests/taler: fix currency withdrawal confirmation --- nixos/tests/taler/tests/basic.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/tests/taler/tests/basic.nix b/nixos/tests/taler/tests/basic.nix index c8b860701506..ec9f592269a9 100644 --- a/nixos/tests/taler/tests/basic.nix +++ b/nixos/tests/taler/tests/basic.nix @@ -189,11 +189,16 @@ import ../../make-test-python.nix ( # Accept & confirm withdrawal with subtest("Accept & confirm withdrawal"): - wallet_cli(f"withdraw accept-uri {withdrawal["taler_withdraw_uri"]} --exchange http://exchange:8081/") + # the withdrawal can only be confirmed if this is executed twice, for some reason + for i in range(2): + wallet_cli(f"withdraw accept-uri {withdrawal["taler_withdraw_uri"]} --exchange 'http://exchange:8081/'") + client.sleep(5) # needs some time to process things + succeed(client, [ "curl -X POST", f"-H 'Authorization: Bearer {accessTokenUser}'", "-H 'Content-Type: application/json'", + f"""--data '{{"amount": "{balanceWanted}"}}'""", # double brackets escapes them f"-sSfL 'http://bank:8082/accounts/${TUSER}/withdrawals/{withdrawal["withdrawal_id"]}/confirm'" ])