haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
663 stars 96 forks source link

Spinner causes hang #405

Open pbiggar opened 3 years ago

pbiggar commented 3 years ago

I've been trying to debug some test hangs for a couple of days. After commenting out nearly all my code, I came to a startling and frustrating realization: it's the test framework that's hanging.

To test this, I turned on --no-spinner and ran my tests in a loop overnight. No hang. Without --no-spinner, my test suite of 216 tests will hang about 20% of the time.

This occurs on 9.0.2 (latest on nuget) as well as on master (I used the line github haf/expecto:8fb043f1de5c847979c4ccb2fa7c14696bfafe55 in my paket.dependencies).

The code is here if that's helpful: https://github.com/darklang/dark/blob/paul/more-fscheck/fsharp-backend/tests/Tests/Tests.fs

haf commented 3 years ago

I'm really sorry for you having had a bad experience: you're right in that the spinner sometimes causes hangs.

It's somewhere here https://github.com/haf/expecto/blob/master/Expecto/Logging.fs#L741 and https://github.com/haf/expecto/blob/8fb043f1de5c847979c4ccb2fa7c14696bfafe55/Expecto/Expecto.Impl.fs#L736-L755 — but despite it not being many lines at code at all I haven't been able to spot the mistake.

I have a WIP rewrite of this — but unfortunately I haven't been able to finish it due to lack of time. PR:s welcome.

pbiggar commented 3 years ago

No worries, it happens! Perhaps the spinner should be disabled by default for now?