-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Default scenario logging does not show up in step notifications #2563
Comments
I'm not sure I understand what you mean. A step definition is a Java method. What do you mean when you say logs should be shown in step definitions? Do you mean they should be printed to STDOUT? |
If it's about logs not being printed to STDOUT, it could be a regression introduced in #2541 where there were some changes about how output is flushed. |
Ah, sorry, I meant step notifications.... (check screenshots).
Partly yes - If i click on step notification (7.3.4), there are no logs flushed to STDOUT. However, at the same time if i click on scenario notification level, all logs in STDOUT are visible. 7.3.2 / or below - all good for both cases. So the problem is related only with step notifications feature, which is enabled via: CucumberOptions -> stepNotifications = true. |
The problem isn't a lack of flushing, the problem is too much buffering. cucumber-jvm/core/src/main/java/io/cucumber/core/plugin/PrettyFormatter.java Lines 51 to 53 in 44e0bfd
The This buffer could be eliminated by adding support for a Once supported the public PrettyFormatter(PrintStream out) {
this.out = new NiceAppendable(out);
} However note: cucumber-jvm/core/src/main/java/io/cucumber/core/plugin/PluginFactory.java Lines 54 to 59 in 44e0bfd
To prevent closing |
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
π What did you see?
Scenario logs (scenario.log()) does not show up in step notifications. This started happening since 7.3.3 version.
β What did you expect to see?
Logs should be shown in step notifications.
π¦ Which tool/library version are you using?
Maven project
Intellij 2022.1
π¬ How could we reproduce it?
Steps to reproduce the behavior:
π Any additional context?
This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: