Skip to content

drain/hasPendingOperations seems broken: tests/async/testmanyasyncevents.nim recently very flaky on windows #14885

Open
@timotheecour

Description

@timotheecour

this could be a recent regression (since #14849 at least but I don't see how this PR would be the root cause) or maybe the problem is from earlier on; but according to https://dev.azure.com/nim-lang/Nim/_test/analytics?definitionId=1&contextType=build it's since 2020-06-30.

  • drain is still broken on windows, in particular tests/async/testmanyasyncevents.nim is very flaky on windows.
  • as you can see in WIP #14853 (to make async joinable), a lot of async tests would fail on windows if joined through megatest, ie, hasPendingOperations would return true instead of false, at least at module scope (haven't tried in proc scope or block scope); this seems related.

Example

I keep seeing these failures in a lot of my PR's recently:
https://dev.azure.com/nim-lang/255dfe86-e590-40bb-a8a2-3c0295ebdeb1/_apis/build/builds/6605/logs/94

2020-07-02T14:50:23.9151912Z FAIL: tests/async/testmanyasyncevents.nim C
2020-07-02T14:50:23.9153015Z Test "tests\async\testmanyasyncevents.nim" in category "async"
2020-07-02T14:50:23.9153827Z Failure: reOutputsDiffer
2020-07-02T14:50:23.9155038Z Expected:
2020-07-02T14:50:23.9727753Z hasPendingOperations: false
2020-07-02T14:50:24.3853674Z triggerCount: 100
2020-07-02T14:50:24.4513555Z 
2020-07-02T14:50:24.5775716Z Gotten:
2020-07-02T14:50:24.6880714Z hasPendingOperations: true
2020-07-02T14:50:24.6882296Z triggerCount: 55
2020-07-02T14:50:24.6882759Z

Additional Information

Drain was totally broken
it's because the Azure VM's are slow and can easily stall async. Slowing down the test by increasing the timeouts solved the problem.
I'm not sure I'm completely satisfied by this solution, but it's good enough for now, and hopefully good enough to merge.

so maybe there is a more robust fix? /cc @rayman22201

note

this is the most flaky test according to https://dev.azure.com/nim-lang/Nim/_test/analytics?definitionId=1&contextType=build as you can see by filtering by branch and selecting refs/heads/devel

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions