#1770: fix setup hanging due to buffered log output during license prompt#1774
Conversation
…sh' into bugfix/1770-fix-setup-stdout-flush
Pull Request Test Coverage Report for Build 23639594901Details
💛 - Coveralls |
hohwille
left a comment
There was a problem hiding this comment.
@shodiBoy1 thanks for your PR. You definitely found the right spot to fix this bug. Nice work 👍
However, your changes will fix the bug but IMHO cause another bug.
See #754 and all the previous issues linked from there.
Please have a look at my review comment and retest and probably rework.
BTW: IMHO we should be able to verify the bug with JUnit first and then fix it following red/green pattern so you first write a test reproducing the bug that is red, then you fix the bug and see that your test turned green now. This helps us to continuously improve our tests and ensure that bugs that we once had fixed do not show up again. BTW: currently tests skip the license agreement due to this:
IDEasy/cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java
Lines 1321 to 1325 in 8abe2c6
The better patttern would be to make the method protected and override it in AbstractIdeTestContext or IdeTestContext to implement the skip but leave some option to keep it active in the test. Let me know if you need further details or help on this.
cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java
Outdated
Show resolved
Hide resolved
…ing processable output
…ing processable output
…sh' into bugfix/1770-fix-setup-stdout-flush
hohwille
left a comment
There was a problem hiding this comment.
@shodiBoy1 thanks for the update. This looks like the perfect solution now.
I still want this duplicated activation of the logging but can do that outside since it is not directly related to this bug.
This PR fixes #1770
Implemented changes:
configureJavaUtilLogging(cmd)call beforeensureLicenseAgreement(cmd)inAbstractIdeContext.applyAndRun()so the log buffer is flushed and output is visible before the useris prompted for input
Checklist for this PR
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If noissue ID exists, title only.
In Progressand assigned to you or there is no issue (might happen for verysmall PRs)
conventions
CHANGELOG.adoc unless issue is labeled
with
internal