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

[RSDK-9365] increase timeout on flaky test #372

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattjperez
Copy link
Member

@mattjperez mattjperez commented Jan 7, 2025

the test has occasionally tripped, poisoning the global_network_lock (fixed).
It's unclear how much time it would be needed to ensure it doesn't trip (or if other manageable factors are involved), but 1sec seems like a still-acceptable upper-bound on a single test. still faster than running the whole CI workflow again.

If other tests with similar timeouts have this issue it might make sense to make the timeout value global for tests.

@mattjperez mattjperez requested a review from a team as a code owner January 7, 2025 16:41
@@ -1357,7 +1357,7 @@ mod tests {
let _task = cloned_exec.spawn(async move {
viam_server.run().await;
});
let _ = Timer::after(Duration::from_millis(500)).await;
let _ = Timer::after(Duration::from_millis(1000)).await;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a way you can completely eliminate the possibility of a race between the _fake_server_task and the viam_server.run() task given what we have now, but you can I think significantly shrink the window. Put some sort of condvar like object into play, and have the app.auth_fn signal it when it. Then, wait on it before asserting on the state of cloned_ram_storage. That will at least guarantee that the auth endpoint on run_fake_app_server was invoked, meaning that the viam server has progressed far enough to have attempted it. You will still need a timeout, but I'll bet a much smaller one than 500 milliseconds will be effective in practice, rather than goign the other way and just doubling the timeout to one second.

A fully deterministic solution would probably require adding hooks into ViamServer to allow tests to wait for it to have progressed to certain will known states, and we don't have that now. We probably should at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants