Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Jan 8, 2022

There were some instances of async calls being blocking by the use of
.Wait() on the task, in various Check* methods. And that would cause
completions to get blocked, and not get run.

In some cases, we didn't await the task at all, and so failures in that
would only fail randomly.

This removes all uses of .Wait(), and makes the methods async, and
correctly awaits on them.

Fixes #62661 .

@ghost ghost added the area-Debugger-mono label Jan 8, 2022
@ghost ghost assigned radical Jan 8, 2022
@ghost
Copy link

ghost commented Jan 8, 2022

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

Issue Details

null

Author: radical
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

@radical radical force-pushed the debug-array-tests branch 4 times, most recently from d4240ca to 00d96f3 Compare January 9, 2022 09:35
@radical radical changed the title [IGNORE] debugging debugger array tests [wasm][debugger] Fix hang in ArrayTests Jan 9, 2022
There were some instances of async calls being blocking by the use of
`.Wait()` on the task, in various `Check*` methods. And that would cause
completions to get blocked, and not get run.

In some cases, we didn't await the task at all, and so failures in that
would only fail randomly.

This removes all uses of `.Wait()`, and makes the methods async, and
correctly awaits on them.
.. to make it clearer that it's safe to use `.Result` on it, without
blocking.
Fails with:
```
  Failed DebuggerTests.SteppingTests.CheckResetFrameNumberForEachStep [299 ms]
  Error Message:
   Assert.Equal() Failure
                                 ↓ (pos 46)
Expected: ···/debugger-test.cs#806#8
Actual:   ···/debugger-test.cs#802#8
                                 ↑ (pos 46)
```

The test code depends on

`private Func<DateTime> todayFunc = () => DateTime.Now;`

.. and checking `f (today.DayOfWeek == DayOfWeek.Sunday)`,
causing it to fail on Sundays.
This didn't always fail because the async lambda with the checks wasn't
awaited.

```
[xUnit.net 00:00:03.78]     DebuggerTests.ArrayTests.InvalidAccessors [FAIL]
  Failed DebuggerTests.ArrayTests.InvalidAccessors [451 ms]
  Error Message:
   [] Could not find variable 'c'
Expected: True
Actual:   False
  Stack Trace:
     at DebuggerTests.DebuggerTestBase.GetAndAssertObjectWithName(JToken obj, String name, String label) in /Users/radical/dev/runtime/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 393
   at DebuggerTests.ArrayTests.<InvalidAccessors>b__14_0(JToken locals) in /Users/radical/dev/runtime/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs:line 632
   at DebuggerTests.DebuggerTestBase.CheckInspectLocalsAtBreakpointSite(String type, String method, Int32 line_offset, String bp_function_name, String eval_expression, Func`2 locals_fn, Func`2 wait_for_event_fn, Boolean use_cfo, String assembly, Int32 col) in /Users/radical/dev/runtime/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 239
   at DebuggerTests.ArrayTests.InvalidAccessors() in /Users/radical/dev/runtime/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs:line 626
```
@radical radical requested review from lewing and thaystg January 10, 2022 01:48
@radical radical marked this pull request as ready for review January 10, 2022 01:48
@radical radical requested a review from marek-safar as a code owner January 10, 2022 01:48
@radical
Copy link
Member Author

radical commented Jan 10, 2022

Once the current run passes, I'll add back rest of the builds.

@radical radical added the arch-wasm WebAssembly architecture label Jan 10, 2022
@ghost
Copy link

ghost commented Jan 10, 2022

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

Issue Details

Fixes #62661 .

Author: radical
Assignees: radical
Labels:

arch-wasm, area-Debugger-mono

Milestone: -

@radical
Copy link
Member Author

radical commented Jan 10, 2022

/azp run runtime-manual

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical
Copy link
Member Author

radical commented Jan 10, 2022

@radical radical merged commit f9a1c78 into dotnet:main Jan 10, 2022
@radical radical deleted the debug-array-tests branch January 10, 2022 20:21
@ghost ghost locked as resolved and limited conversation to collaborators Feb 10, 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.

[wasm][debugger] ArrayTests timing out on helix

2 participants