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

Sleep between file copies and serve for macOS serve tests #945

Merged
merged 1 commit into from
Jul 20, 2024
Merged
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
9 changes: 9 additions & 0 deletions tests/rojo_test/serve_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ impl TestServeSession {
.expect("Couldn't copy project to temporary directory");
};

// This is an ugly workaround for FSEvents sometimes reporting events
// for the above copy operations, similar to this Stack Overflow question:
// https://stackoverflow.com/questions/47679298/howto-avoid-receiving-old-events-in-fseventstream-callback-fsevents-framework-o
// We'll hope that 100ms is enough for FSEvents to get whatever it is
// out of its system.
// TODO: find a better way to avoid processing these spurious events.
#[cfg(target_os = "macos")]
std::thread::sleep(Duration::from_millis(100));

let port = get_port_number();
let port_string = port.to_string();

Expand Down
Loading