From 9edb72257d9a54cc84a6d3fd2b26cc28fb579338 Mon Sep 17 00:00:00 2001 From: Joy Wang <108701016+joyqvq@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:37:28 -0400 Subject: [PATCH] fix: handle nondeterminism in test (#18841) ## Description my guess is the modified signature byte is already 0 and does not need modification. fix here is to deterministically flip the byte. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-e2e-tests/tests/passkey_e2e_tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/sui-e2e-tests/tests/passkey_e2e_tests.rs b/crates/sui-e2e-tests/tests/passkey_e2e_tests.rs index 699fd96afa842..505f240d82edc 100644 --- a/crates/sui-e2e-tests/tests/passkey_e2e_tests.rs +++ b/crates/sui-e2e-tests/tests/passkey_e2e_tests.rs @@ -303,7 +303,11 @@ async fn test_passkey_fails_to_verify_sig() { let test_cluster = TestClusterBuilder::new().build().await; let response = create_credential_and_sign_test_tx(&test_cluster, None, false, false).await; let mut modified_sig = response.user_sig_bytes.clone(); - modified_sig[1] = 0x00; + if modified_sig[1] == 0x00 { + modified_sig[1] = 0x01; + } else { + modified_sig[1] = 0x00; + } let sig = GenericSignature::PasskeyAuthenticator( PasskeyAuthenticator::new_for_testing( response.authenticator_data,