From 2dec11e1e49d345e7d7a3338136f10be09fad4bd Mon Sep 17 00:00:00 2001 From: Cesar Rodas Date: Mon, 28 Apr 2025 18:53:41 -0300 Subject: [PATCH] Fix race conditions Because of the nature of Rust tests, the nutshell integration test has a race condition. Triggering the issue in the local environment was hard, but it happens more often in #509 because all the keys are read from memory without blocking the database. The error happens because, by default, Rust tests run in parallel, and maybe by design or by mistake, the external wallet did not increase its counter until the completion of the minting. This led to some tests having the same blinded messages, and the fastest test would mint successfully. The slowest test would result in the CDK failing to sign duplicated blinded messages. In any case, the fix is on the rust side, running the tests sequentially. --- misc/nutshell_wallet_itest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/nutshell_wallet_itest.sh b/misc/nutshell_wallet_itest.sh index e468852b..f7f36cd3 100755 --- a/misc/nutshell_wallet_itest.sh +++ b/misc/nutshell_wallet_itest.sh @@ -156,8 +156,8 @@ export CDK_TEST_MINT_URL=${MINT_URL} # Run the integration test echo "Running integration test..." -cargo test -p cdk-integration-tests --test nutshell_wallet -cargo test -p cdk-integration-tests --test test_fees +cargo test -p cdk-integration-tests --test nutshell_wallet -- --test-threads 1 +cargo test -p cdk-integration-tests --test test_fees -- --test-threads 1 TEST_STATUS=$? # Exit with the test status