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.
This commit is contained in:
Cesar Rodas
2025-04-28 18:53:41 -03:00
parent 15e10c0e90
commit 2dec11e1e4

View File

@@ -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