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] Fix a randomly failing JS test #67945

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

radical
Copy link
Member

@radical radical commented Apr 13, 2022

DebuggerTests.ExceptionTests.JSExceptionTestAll can some times fail
with:

[xUnit.net 00:01:08.51]     DebuggerTests.ExceptionTests.JSExceptionTestAll [FAIL]
  Failed DebuggerTests.ExceptionTests.JSExceptionTestAll [105 ms]
  Error Message:
   [{
  "callFrameId": "-2618252572970282349.1.0",
  "functionName": "lookup",

...

Expected: exception_caught_test
Actual:   lookup
  Stack Trace:
     at DebuggerTests.DebuggerTestBase.AssertEqual(Object expected, Object actual, String label) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 1119
   at DebuggerTests.DebuggerTestBase.SendCommandAndCheck(JObject args, String method, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn, String waitForEvent) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 562
   at DebuggerTests.DebuggerTestBase.EvaluateAndCheck(String expression, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 542
   at DebuggerTests.ExceptionTests.JSExceptionTestAll() in /_/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs:line 70

This test is set to pause on every exception thrown, but the test
assumes that the first exception that it gets will be the expected one.
But we can get other JS exceptions before that. So, wait for the correct
one, while ignoring any other js ones.

`DebuggerTests.ExceptionTests.JSExceptionTestAll` can some times fail
with:

```
[xUnit.net 00:01:08.51]     DebuggerTests.ExceptionTests.JSExceptionTestAll [FAIL]
  Failed DebuggerTests.ExceptionTests.JSExceptionTestAll [105 ms]
  Error Message:
   [{
  "callFrameId": "-2618252572970282349.1.0",
  "functionName": "lookup",

...

Expected: exception_caught_test
Actual:   lookup
  Stack Trace:
     at DebuggerTests.DebuggerTestBase.AssertEqual(Object expected, Object actual, String label) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 1119
   at DebuggerTests.DebuggerTestBase.SendCommandAndCheck(JObject args, String method, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn, String waitForEvent) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 562
   at DebuggerTests.DebuggerTestBase.EvaluateAndCheck(String expression, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 542
   at DebuggerTests.ExceptionTests.JSExceptionTestAll() in /_/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs:line 70
```

This test is set to pause on every exception thrown, but the test
assumes that the first exception that it gets will be the expected one.
But we can get other JS exceptions before that. So, wait for the correct
one, while ignoring any *js* ones.
@radical radical added arch-wasm WebAssembly architecture area-Debugger-mono labels Apr 13, 2022
@ghost ghost assigned radical Apr 13, 2022
@ghost
Copy link

ghost commented Apr 13, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

DebuggerTests.ExceptionTests.JSExceptionTestAll can some times fail
with:

[xUnit.net 00:01:08.51]     DebuggerTests.ExceptionTests.JSExceptionTestAll [FAIL]
  Failed DebuggerTests.ExceptionTests.JSExceptionTestAll [105 ms]
  Error Message:
   [{
  "callFrameId": "-2618252572970282349.1.0",
  "functionName": "lookup",

...

Expected: exception_caught_test
Actual:   lookup
  Stack Trace:
     at DebuggerTests.DebuggerTestBase.AssertEqual(Object expected, Object actual, String label) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 1119
   at DebuggerTests.DebuggerTestBase.SendCommandAndCheck(JObject args, String method, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn, String waitForEvent) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 562
   at DebuggerTests.DebuggerTestBase.EvaluateAndCheck(String expression, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 542
   at DebuggerTests.ExceptionTests.JSExceptionTestAll() in /_/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs:line 70

This test is set to pause on every exception thrown, but the test
assumes that the first exception that it gets will be the expected one.
But we can get other JS exceptions before that. So, wait for the correct
one, while ignoring any js ones.

Author: radical
Assignees: -
Labels:

arch-wasm, area-Debugger-mono

Milestone: -

@lewing
Copy link
Member

lewing commented Apr 22, 2022

Failure is unrelated

@lewing lewing merged commit 857f54b into dotnet:main Apr 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 23, 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 this pull request may close these issues.

None yet

3 participants