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

[wasm][debugger] HotReload test failures #72946

Closed
pavelsavara opened this issue Jul 27, 2022 · 6 comments · Fixed by #73524
Closed

[wasm][debugger] HotReload test failures #72946

pavelsavara opened this issue Jul 27, 2022 · 6 comments · Fixed by #73524
Assignees
Labels
arch-wasm WebAssembly architecture area-Debugger-mono
Milestone

Comments

@pavelsavara
Copy link
Member

pavelsavara commented Jul 27, 2022

Error: System.NullReferenceException: Object reference not set to an instance of an object.
    at TestHotReloadUsingSDB.RunMethod(String className, String methodName) in /_/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs:line 990
    at mo (http://localhost:9400/dotnet.js:3:51791)
    at wo (http://localhost:9400/dotnet.js:3:52354)
    at _debugger_test__TestHotReloadUsingSDB_RunMethod (https://mono-wasm.invalid/_debugger_test__TestHotReloadUsingSDB_RunMethod:23:5)
    at invoke_static_method (http://localhost:9400/debugger-driver.html:27:11)
    at <anonymous>:1:32

seen on unrelated PR

Log

[xUnit.net 00:34:34.87]     DebuggerTests.ExceptionTests.ExceptionTestUncaughtWithReload [FAIL]
Expected: DebuggerTests.ExceptionTestsClass.TestUncaughtException.run
Actual:   invoke_static_method
  Stack Trace:
     at DebuggerTests.DebuggerTestBase.AssertEqual(Object expected, Object actual, String label) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 1136
   at DebuggerTests.ExceptionTests.ExceptionTestUncaughtWithReload() in /_/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs:line 251
--- End of stack trace from previous location ---
[xUnit.net 00:42:02.91]     DebuggerTests.HotReloadTests.DebugHotReloadMethodChangedUserBreak [FAIL]
  Failed DebuggerTests.HotReloadTests.DebugHotReloadMethodChangedUserBreak [8 ms]
  Error Message:
   Assert.True() Failure
Expected: True
Actual:   False

Log

[xUnit.net 00:40:47.22]     DebuggerTests.HotReloadTests.DebugHotReloadMethodChangedUserBreak [FAIL]
  Failed DebuggerTests.HotReloadTests.DebugHotReloadMethodChangedUserBreak [15 ms]
  Error Message:
   Assert.True() Failure
Expected: True
Actual:   False
  Stack Trace:
     at DebuggerTests.DebuggerTestBase.LoadAssemblyAndTestHotReload(String asm_file, String pdb_file, String asm_file_hot_reload, String class_name, String method_name) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 1387
   at DebuggerTests.HotReloadTests.DebugHotReloadMethodChangedUserBreak() in /_/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs:line 21

Log

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Debugger-mono labels Jul 27, 2022
@pavelsavara pavelsavara added this to the 7.0.0 milestone Jul 27, 2022
@ghost
Copy link

ghost commented Jul 27, 2022

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details
Error: System.NullReferenceException: Object reference not set to an instance of an object.
    at TestHotReloadUsingSDB.RunMethod(String className, String methodName) in /_/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs:line 990
    at mo (http://localhost:9400/dotnet.js:3:51791)
    at wo (http://localhost:9400/dotnet.js:3:52354)
    at _debugger_test__TestHotReloadUsingSDB_RunMethod (https://mono-wasm.invalid/_debugger_test__TestHotReloadUsingSDB_RunMethod:23:5)
    at invoke_static_method (http://localhost:9400/debugger-driver.html:27:11)
    at <anonymous>:1:32

seen on unrelated PR

Log

Author: pavelsavara
Assignees: thaystg
Labels:

arch-wasm, area-Debugger-mono

Milestone: 7.0.0

@ilonatommy
Copy link
Member

ilonatommy commented Aug 2, 2022

Head on 0ef117e, all of above are passing.

@ilonatommy
Copy link
Member

Might be random race as @pavelsavara says it was passing on CI re-run.

@ilonatommy ilonatommy reopened this Aug 2, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 7, 2022
@radical radical changed the title [wasm][debugger] test failure [wasm][debugger] HotReload test failures Aug 7, 2022
radical added a commit that referenced this issue Aug 9, 2022
## 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 #66024
Fixes #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 #69144 .

## 3. Fix a race condition where the tests start calling methods before the app is ready

Fixes #73528
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 9, 2022
@lewing
Copy link
Member

lewing commented Aug 15, 2022

[xUnit.net 00:36:58.27]     DebuggerTests.ExceptionTests.ExceptionTestUncaughtWithReload [FAIL]
  Failed DebuggerTests.ExceptionTests.ExceptionTestUncaughtWithReload [1 s]
  Error Message:
   [pause1]

Expected: DebuggerTests.ExceptionTestsClass.TestUncaughtException.run
Actual:   invoke_static_method
  Stack Trace:
     at DebuggerTests.DebuggerTestBase.AssertEqual(Object expected, Object actual, String label) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 1184
   at DebuggerTests.ExceptionTests.ExceptionTestUncaughtWithReload() in /_/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs:line 251
--- End of stack trace from previous location ---
[Result: IsOk: True, IsErr: False, Value: {
  "breakpointId": "1:539:8:dotnet://debugger-test.dll//_/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs",
  "locations": [
    {
      "scriptId": "dotnet://26565_1",
      "lineNumber": 542,
      "columnNumber": 8
    }
  ]
}, Error:  ]
[Result: IsOk: True, IsErr: False, Value: {
  "breakpointId": "1:1272:8:dotnet://debugger-test.dll//_/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs",
  "locations": []
}, Error:  ]
Results File: C:\helix\work\workitem\uploads\xharness-output\logs\testResults.trx

@thaystg
Copy link
Member

thaystg commented Aug 15, 2022

Created a new issue to fix this: #73957

@ghost ghost locked as resolved and limited conversation to collaborators Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Debugger-mono
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants