streamly icon indicating copy to clipboard operation
streamly copied to clipboard

Exception tests failing intermittently

Open pranaysashank opened this issue 4 years ago • 1 comments
trafficstars

Tests added in this PR #783, bracketPartialStreamProp and finallyPartialStreamProp are failing on the CI mostly due to timing issues. However the tests beforeProp and afterProp are failing in Prelude.Parallel most likely due to some undiscovered bug.

CI output

2020-12-06T10:11:29.8436037Z Failures:
2020-12-06T10:11:29.8436296Z 
2020-12-06T10:11:29.8437322Z   test/Streamly/Test/Prelude/Common.hs:1586:5: 
2020-12-06T10:11:29.8438080Z   1) Tests for exceptions, maxBuffer 0, parallely before
2020-12-06T10:11:29.8438767Z        Assertion failed (after 3 tests):
2020-12-06T10:11:29.8439508Z          [-2,0]
2020-12-06T10:11:29.8439880Z          stream [0,0]
2020-12-06T10:11:29.8440421Z          list   [0,-2,0]
2020-12-06T10:11:29.8441066Z          stream \\ list []
2020-12-06T10:11:29.8441681Z          list \\ stream [-2]
2020-12-06T10:11:29.8441961Z 
2020-12-06T10:11:29.8442814Z   To rerun use: --match "/Tests for exceptions/maxBuffer 0/parallely before/"
2020-12-06T10:11:29.8443369Z 
2020-12-06T10:11:29.8443860Z   test/Streamly/Test/Prelude/Common.hs:1586:5: 
2020-12-06T10:11:29.8444612Z   2) Tests for exceptions, maxThreads 1, parallely before
2020-12-06T10:11:29.8445344Z        Assertion failed (after 4 tests and 1 shrink):
2020-12-06T10:11:29.8446000Z          [0,-2,2]
2020-12-06T10:11:29.8446513Z          stream [0,-2,0]
2020-12-06T10:11:29.8447058Z          list   [0,-2,0,2]
2020-12-06T10:11:29.8447468Z          stream \\ list []
2020-12-06T10:11:29.8447903Z          list \\ stream [2]
2020-12-06T10:11:29.8448348Z 
2020-12-06T10:11:29.8449197Z   To rerun use: --match "/Tests for exceptions/maxThreads 1/parallely before/"CI output:

pranaysashank avatar Dec 06 '20 12:12 pranaysashank

Turns out there was a race condition in the tests for before and after. Fixed it in #783. The other tests still keep failing probably because of a race condition + late cleanup of threads..

pranaysashank avatar Dec 06 '20 14:12 pranaysashank