-
Notifications
You must be signed in to change notification settings - Fork 1k
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
FileAlreadyExistsException when report is generated #2770
Comments
We are seeing this with egeria ( https://github.com/odpi/egeria ) under maven. testng 7.5 works fine. 7.6.0 introduced the issue, which continues into 7.6.1 I was testing with
surefire plugin is 3.0.0-M7 (also occurs with M6/M5) Example: /Users/jonesn/IdeaProjects/egeria/master/open-metadata-implementation/frameworks/open-connector-framework/target/surefire-reports/jquery-3.6.0.min.js |
I am also observing this in both 7.6.0 and 7.6.1, as stated by OP 7.5 is ok |
Our company has the same issue. Yes it is somewhat "ignorable" but would be nice if this is not happening :D |
@codenox-vs Maybe your company wants to propose a fix? |
@codenox-vs @Ordiel @planetf1 @JanVomlel - Can one of you please help create and share a sample test project that can be used to reproduce the problem? For some reason I am not able to recreate it. This is how my gradle build file looks like /*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.3.3/samples
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
java
idea
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/org.testng/testng
testImplementation("org.testng:testng:7.6.1")
}
tasks.test {
testLogging.showStandardStreams = true
useTestNG {
useDefaultListeners = true
val options = this as TestNGOptions
options.suites("src/test/resources/testng.xml")
}
reports.html.required.set( false)
} This is how my test case looks like import org.testng.annotations.Test;
public class HelloWorld {
@Test
public void testMethod() {}
@Test
public void anotherTestMethod() {}
@Test
public void thirdTest() {}
} This is how my suite file looks like <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Default Suite">
<test thread-count="5" name="testng_playground" verbose="2">
<classes>
<class name="com.rationaleemotions.HelloWorld">
</class>
</classes>
</test> <!-- testng_playground -->
</suite> <!-- Default Suite --> And this is how my command output looks like ➜ test_example ./gradlew test
> Task :test
Gradle Test Executor 4 STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Default Suite STANDARD_OUT
PASSED: com.rationaleemotions.HelloWorld.thirdTest
PASSED: com.rationaleemotions.HelloWorld.anotherTestMethod
PASSED: com.rationaleemotions.HelloWorld.testMethod
===============================================
testng_playground
Tests run: 3, Failures: 0, Skips: 0
===============================================
BUILD SUCCESSFUL in 2s
3 actionable tasks: 2 executed, 1 up-to-date |
We see this too in all our projects |
@melloware how about sharing a sample project which I can use to reproduce the problem ? |
@krmahadevan the bug is right here: it needs to be... Files.copy(cfgFilePath, strTarget, StandardCopyOption.REPLACE_EXISTING); |
@melloware - Thanks for pointing out the line of code. It would help if there's a reproducible so that we can add a test as well that would ensure that going forward the bug doesn't come up again. Alternatively we would be more than glad to help merge a PR if you would like to raise one (especially since you have taken the effort to identify the line of code as well that is causing the problem). |
Ok I will do. One thing to note I have a feeling this is Windows bug are you running your example in Windows or some other Os? If you look in the stack trace is definitely mentions WindowsFileSystem which has different locking than Linux. |
@melloware - Good catch! That could be the reason. I am running on a OSX machine which perhaps is why I couldn't reproduce it. |
Ok I will submit a PR. |
We have observed this issue on linux with eclipse. I'll see if I can provide a reproducer. |
PR submitted |
Thanks @melloware , I just started experiencing this issue on the latest version as well. Can't wait for the PR to be merged! |
@krmahadevan the reason you were not able to reproduce is probably this warning
Because the nop logger is used, the exception is not logged to the console (from there https://github.com/cbeust/testng/blob/master/testng-core/src/main/java/org/testng/reporters/jq/Main.java#L103) |
still happening on mac with latest testng |
@turnitin-rshanker - Without a sample to reproduce the problem, there's not much that can be done here to figure out what is going wrong. |
TestNG Version
7.6.0
7.5 is ok
Expected behavior
Generate test reports without errors in console.
Actual behavior
Is the issue reproducible on runner?
Test case sample
useTestNG() {
useDefaultListeners = true
}
The text was updated successfully, but these errors were encountered: