-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
Change OutputStream object to BufferedOutputStream in order to solve allure-framework/allure-java#197 . Tested and verified.
@@ -37,7 +36,7 @@ public void write(TestResult testResult) { | |||
: generateTestResultName(testResult.getUuid()); | |||
createDirectories(outputDirectory); | |||
Path file = outputDirectory.resolve(testResultName); | |||
try (OutputStream os = Files.newOutputStream(file, CREATE_NEW)) { | |||
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file.toString()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using new BufferedOutputStream(Files.newOutputStream(file, CREATE_NEW))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debugged both operations, the former causes the allure results exeception. It's reproduced here: https://github.com/AutomatedOwl/allure-testng-result-write-bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, let me check it
PS you need to add aspectjweaver
dependency to maven surefire plugin in order to run it (I got no aspectjweaver:1.9.1 in my local maven repo, so build fails)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated pom.xml at https://github.com/AutomatedOwl/allure-testng-result-write-bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess we need to use blocking io, so your solution is fine. Please replace file.toString()
with file.toFile()
and update other methods write
as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baev changes done
Implemented FileOutputStream in second write method.
@baev thanks, what's missing now for it to be merged? |
@AutomatedOwl waiting for Jenkins (will fix it myself) BTW it would be so nice if you remove wildcard imports from your patch |
@AutomatedOwl thanks! |
@baev amazing, thanks! first commit but not the last :) |
Changed OutputStream object to BufferedOutputStream in order to solve allure-framework/allure-java#197 .
Tested and verified.