testng-team / testng

TestNG testing framework
https://testng.org
Apache License 2.0
1.98k stars 1.02k forks source link

java.util.ConcurrentModificationException after testng upgrade to 7.0.0-beta3 #2095

Closed hnestorova closed 5 years ago

hnestorova commented 5 years ago

TestNG Version

7.0.0-beta3

Expected behavior

all tests classes run successfully as with testng 16.4.3

Actual behavior

some test classes get skipped and in Jenkins console we see: [testng] Exception in thread "TestNG-test=X-3" Exception in thread "TestNG-test=X-2" java.util.ConcurrentModificationException [testng] at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134) [testng] at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:162) [testng] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122) [testng] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [testng] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [testng] at java.base/java.lang.Thread.run(Thread.java:834) [testng] java.util.ConcurrentModificationException [testng] at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134) [testng] at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:162) [testng] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122) [testng] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [testng] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [testng] at java.base/java.lang.Thread.run(Thread.java:834)

Test case sample

The testng xml looks like:

krmahadevan commented 5 years ago

This is a duplicate of https://github.com/cbeust/testng/issues/2000

2000 has been fixed. Please try again with the latest released version of TestNG viz., 7.0.0-beta5.

PS: You may need to add a repository entry to refer to JCenter as well.

This SO post should give you some help, if you are looking for any, with respect to specifying JCenter repository in your pom file.