Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed race condition in tests assuming TEST_EVENT_OBSERVER_SKIP_RETRY… #5669

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions testnet/stacks-node/src/event_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,12 @@ mod test {

let url = &format!("{}/api", &server.url());

// Ensure retrying is enabled on the test (as other tests will run in parallel)
TEST_EVENT_OBSERVER_SKIP_RETRY
.lock()
.unwrap()
.replace(false);

// Insert payload
EventObserver::insert_payload(&conn, url, &payload, timeout)
.expect("Failed to insert payload");
Expand Down Expand Up @@ -2129,6 +2135,12 @@ mod test {

let observer = EventObserver::new(Some(working_dir.clone()), endpoint, timeout);

// Ensure retrying is enabled on the test (as other tests will run in parallel)
TEST_EVENT_OBSERVER_SKIP_RETRY
.lock()
.unwrap()
.replace(false);

// Call send_payload
observer.send_payload(&payload, "/test");

Expand Down
Loading