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

[dwds] Race condition when establishing a tab connection and processing socket connections/requests in eval tests. #2298

Closed
Markzipan opened this issue Dec 8, 2023 · 0 comments · Fixed by #2295

Comments

@Markzipan
Copy link
Contributor

Markzipan commented Dec 8, 2023

To reproduce:

Add Future.delayed(Duration(seconds: 3)) (or equivalent) just before the line containing getTab (between 404 and 405).
Then run https://github.com/dart-lang/webdev/blob/master/dwds/test/frontend_server_evaluate_sound_test.dart

Observation:

The test times out waiting for a connection. If you enable debug mode on the test, you can see that the test is still running in the chrome window (prints in a loop forever), but it's never "discovered" by the test framework.

I'm still doing some investigation, but it appears there's some interleaving execution-order dependency effect between this logic and establishing a tab connection.

This means changing the async characteristics of any code in either of these two pathways can lock the program. We seem to depend on logic in both pathways executing partially (but not fully) and in a particular order. You can see an early attempt at fixing this in this PR.

I've only observed this when running tests (so far).

@Markzipan Markzipan changed the title [dwds] Race condition when establishing a tab connection and processing socket connections/requests. [dwds] Race condition when establishing a tab connection and processing socket connections/requests in eval tests. Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant