-
Notifications
You must be signed in to change notification settings - Fork 455
parallel: drop --keep-order to stream test output with -j #826
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
base: master
Are you sure you want to change the base?
Conversation
624b534 to
3b24035
Compare
|
Hmmm, this isn't sufficient. |
|
Even if we we're only using parallel, without |
|
GNU Parallel doesn't interleave output by default (the management process waits for the job to finish then outputs the collected stdout and stderr in one go). You can enable interleaving with I can add |
|
Well then you still dont get intermediate Output, Theo only improvement would be to not wait on slower earlier tests. My plan is to replace parallel with the bats internal bash semaphores, which would allow custom handling of the output. |
|
The issue is that currently
If the plan is to repurpose the file-level semaphore stuff for the whole suite, fixing the file-level stuff to not wait for tests to finish in order is still necessary. |
|
Oh, now I see what you meant by:
Because even single-file test runs are run as a "suite" and we use GNU Parallel for suite runs, you won't get intermediate output because the whole file run needs to finish for GNU Parallel to output anything. That is really unfortunate... Yeah, I think the only "nice" solution would be to migrate the parallel logic in There are some other possible workarounds (prepending all lines from In any case, I'll push a version that allows for un-collated |
3b24035 to
eeaa352
Compare
|
@martin-schulze-vireso Did this issue ever get resolved? It seems that bats was switched to using bash semaphores now, but AFAICS the latest version still waits for all tests to complete before outputting anything about the test suite. |
|
No, I did not find time for that. |
eeaa352 to
7d0050f
Compare
The --keep-order argument was included in the call to GNU parallel to the initial parallelism implementation back in commit da65d1b ("bats: add support for parallel job execution with GNU parallel"). My concern at the time was that some parsers of TAP output might struggle to handle out-of-order results. However, the TAP specification explicitly states that this is permitted behaviour: > Test Points may be output in any order, but any Test Point ID > provided must be within the range described by the Plan. The current state of bats is such that "--jobs" effectively makes bats test runs completely silent until the very end, which is not very user-friendly. To resolve this issue, this patch changes the behaviour to simply stream the output (and adds a --parallel-ordered-output flag for users that desire the old behaviour). Note that this does not affect the ordering of per-file tests, as those are run by a different parallelisation system that would be a bit harder to add support for out-of-order output. This is left for future work. Signed-off-by: Aleksa Sarai <[email protected]>
7d0050f to
9254638
Compare
|
@martin-schulze-vireso I reworked this -- I think that just removing EDIT: D'oh, I re-read the above comments and I think the same issue still applies... |
The Tap 14 specification explicitly allows for out-of-order Test Points, which means we do not need to use --keep-order. The primary benefit of doing this is that users will get more feedback during long test runs as to whether tests are passing or not.
Technically, Tap 13 didn't disallow out-of-order Test Points (and implies they are allowed) but at the time of implementing "bats -j" support this wasn't clear enough to justify the risk of producing spec-invalid output.
Fixes: da65d1b ("bats: add support for parallel job execution with GNU parallel")
Signed-off-by: Aleksa Sarai [email protected]