-
Notifications
You must be signed in to change notification settings - Fork 253
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
Running with concurrency shouldn't intermingle the test outputs #643
Comments
The suggestion is one possibility, but would result in silence for protracted periods. The reality of the situation is that folk will use things like fmt.* and even the root println fn, and unlike the JVM sadly golang doesn't provide a reliable way to intercept stdout/stderr to capture that output to defer logging. What does work (for godog and other MT code) is to create a logger for each goroutine (eg in the before scenario), and to pass that logger to each step via the context object and then that logger can aggregate output until the after scenario where it could be logged en-masse. This approach also has advantages as you can attache the captured console to the steps as you go along so that it's available in HTML report and so on. |
does it only deal with the formatters or also ad-hoc console output from println, fmt* and loggers, which for me has been the main interest. |
Just formatters. Should godog deal with adhoc printing to stdout outside of its domain? I don't think so myself. If I want ordered logging in a concurrent library, then I ought to learn how to use the logging of that library. |
π What did you see?
Example output showing three different test's steps being mixed together
β What did you expect to see?
It would be more readable and easier to debug to hold onto a test's output until it's complete and then write it all at once.
π¦ Which tool/library version are you using?
No response
π¬ How could we reproduce it?
Set
Concurrency: 2
(or more) in the configπ Any additional context?
No response
The text was updated successfully, but these errors were encountered: