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

Spinner causes hang #405

Open
pbiggar opened this issue Dec 22, 2020 · 2 comments
Open

Spinner causes hang #405

pbiggar opened this issue Dec 22, 2020 · 2 comments

Comments

@pbiggar
Copy link

pbiggar commented Dec 22, 2020

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
Copy link
Owner

haf commented Dec 22, 2020

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

ProgressIndicator.text "Expecto Running... "
ProgressIndicator.start()
let w = Stopwatch.StartNew()
let! results = evalTestsWithCancel ct config test progressStarted
w.Stop()
let testSummary = {
results = results
duration = w.Elapsed
maxMemory = 0L
memoryLimit = 0L
timedOut = []
}
do! config.printer.summary config testSummary
if progressStarted then
ProgressIndicator.stop ()
ANSIOutputWriter.close ()
— 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
Copy link
Author

pbiggar commented Dec 22, 2020

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

chrissimon-au added a commit to dev-cycles/contextive that referenced this issue May 24, 2023
…ut (-debug) and avoid locking/hanging issues that occur when the debugger is attached by sequencing tests and turning off the spinner. (See haf/expecto#405 - not a proven cause, but might be related.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants