[wasm][debugger] Fix some racy tests
1. Fix random HotReload test failures
Some of the hot reload tests fail randomly because they call the updated methods too early.
The tests used Thread.Sleep(3000) to wait for the method to get updated, and the proxy
to respond to that. And that's essentially racy.
Instead, wait for the breakpointResolved event, or the scriptParsed events for the methods,
as appropriate.
Fixes https://github.com/dotnet/runtime/issues/66024 Fixes https://github.com/dotnet/runtime/issues/72946
2. Fix race in adding/removing event handlers
Use ConcurrentDictionary for event listeners, and notification handlers, since they can be modified from different threads.
Fixes https://github.com/dotnet/runtime/issues/69144 .
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Issue Details
Some of the hot reload tests fail randomly because they call the updated methods too early.
The tests used Thread.Sleep(3000) to wait for the method to get updated, and the proxy
to respond to that. And that's essentially racy.
Instead, wait for the breakpointResolved event, or the scriptParsed events for the methods,
as appropriate.
Fixes https://github.com/dotnet/runtime/issues/66024 .
| Author: | radical |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
The debugger test failure is https://github.com/dotnet/runtime/issues/73528 .