fix: sealevel unit tests flake (#4655)

### Description

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
pull/4656/head
Daniel Savu 2 months ago committed by GitHub
parent ac2bef9510
commit 45eb3ae5e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      rust/sealevel/programs/validator-announce/tests/functional.rs

@ -1,6 +1,6 @@
use hyperlane_core::{Announcement, H160};
use std::str::FromStr;
use std::{str::FromStr, thread::sleep};
use account_utils::SizedData;
use borsh::BorshSerialize;
@ -300,12 +300,7 @@ async fn test_announce() {
storage_location: announcement.storage_location,
signature,
};
let (
validator_storage_locations_key,
validator_storage_locations_bump_seed,
replay_protection_key,
_replay_protection_bump_seed,
) = announce(
let announcement_res = announce(
&mut banks_client,
&payer,
program_id,
@ -315,6 +310,17 @@ async fn test_announce() {
.await
.unwrap();
// there's a race condition that isn't fixed by setting `CommitmentLevel::Confirmed`
// just wait a bit to ensure the account is created
sleep(std::time::Duration::from_secs(1));
let (
validator_storage_locations_key,
validator_storage_locations_bump_seed,
replay_protection_key,
_replay_protection_bump_seed,
) = announcement_res;
assert_successful_announcement(
&mut banks_client,
program_id,

Loading…
Cancel
Save