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

ConcurrentModificationException in SimpleReport #303

Closed
ken-p opened this Issue Mar 8, 2016 · 10 comments

Comments

Projects
None yet
3 participants
@ken-p

ken-p commented Mar 8, 2016

java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) at java.util.ArrayList$Itr.next(Unknown Source) at java.util.Collections$UnmodifiableCollection$1.next(Unknown Source) at com.codeborne.selenide.logevents.SimpleReport.finish(SimpleReport.java:32) at com.codeborne.selenide.testng.TextReport.onTestSuccess(TextReport.java:31) at org.testng.internal.Invoker.runTestListeners(Invoker.java:1695) at org.testng.internal.Invoker.runTestListeners(Invoker.java:1675) at org.testng.internal.Invoker.invokeMethod(Invoker.java:700) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:782) at org.testng.TestRunner.run(TestRunner.java:632) at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) at org.testng.SuiteRunner.access$000(SuiteRunner.java:39) at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:400) at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Sorry I don't have a reproducible test case, but I can see about working on one if the problem isn't obvious to you. Thanks!

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Mar 8, 2016

Member

Wow, cool!
Thank you for reporting, I will investigate it.
On Mar 8, 2016 9:25 PM, "Ken P" notifications@github.com wrote:

java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.util.ArrayList$Itr.next(Unknown Source)
at java.util.Collections$UnmodifiableCollection$1.next(Unknown Source)
at
com.codeborne.selenide.logevents.SimpleReport.finish(SimpleReport.java:32)
at
com.codeborne.selenide.testng.TextReport.onTestSuccess(TextReport.java:31)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1695)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1675)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:700)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:400)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Sorry I don't have a reproducible test case, but I can see about working
on one if the problem isn't obvious to you. Thanks!


Reply to this email directly or view it on GitHub
#303.

Member

asolntsev commented Mar 8, 2016

Wow, cool!
Thank you for reporting, I will investigate it.
On Mar 8, 2016 9:25 PM, "Ken P" notifications@github.com wrote:

java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.util.ArrayList$Itr.next(Unknown Source)
at java.util.Collections$UnmodifiableCollection$1.next(Unknown Source)
at
com.codeborne.selenide.logevents.SimpleReport.finish(SimpleReport.java:32)
at
com.codeborne.selenide.testng.TextReport.onTestSuccess(TextReport.java:31)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1695)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1675)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:700)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:400)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Sorry I don't have a reproducible test case, but I can see about working
on one if the problem isn't obvious to you. Thanks!


Reply to this email directly or view it on GitHub
#303.

@djangofan

This comment has been minimized.

Show comment
Hide comment
@djangofan

djangofan Mar 25, 2016

@ken-p Are you forking threads by 'methods' or by 'classes' ? IT appears to me that Selenide TextReport class is only designed for fork by class, not by method.

djangofan commented Mar 25, 2016

@ken-p Are you forking threads by 'methods' or by 'classes' ? IT appears to me that Selenide TextReport class is only designed for fork by class, not by method.

@ken-p

This comment has been minimized.

Show comment
Hide comment
@ken-p

ken-p Apr 25, 2016

@djangofan yes, by method.

ken-p commented Apr 25, 2016

@djangofan yes, by method.

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev May 9, 2016

Member

@ken-p it's kind of concurrency issue. Two threads are changing the same list at the same time.
But I cannot see how is it possible.
Please do your best to provide a working example, so that I could reproduce the issue.

Member

asolntsev commented May 9, 2016

@ken-p it's kind of concurrency issue. Two threads are changing the same list at the same time.
But I cannot see how is it possible.
Please do your best to provide a working example, so that I could reproduce the issue.

@ken-p

This comment has been minimized.

Show comment
Hide comment
@ken-p

ken-p May 17, 2016

I haven't seen it since! I'll try to reproduce. Thanks.

ken-p commented May 17, 2016

I haven't seen it since! I'll try to reproduce. Thanks.

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Jul 31, 2016

Member

@ken-p I got it! The problem may happen when you run tests in parallel by TestNG.
See issue #364

Member

asolntsev commented Jul 31, 2016

@ken-p I got it! The problem may happen when you run tests in parallel by TestNG.
See issue #364

@asolntsev asolntsev added this to the 3.8 milestone Jul 31, 2016

@asolntsev asolntsev self-assigned this Jul 31, 2016

@djangofan

This comment has been minimized.

Show comment
Hide comment
@djangofan

djangofan Jul 31, 2016

JUnit5 has removed the @Rule notation. I wonder how that might affect this?

djangofan commented Jul 31, 2016

JUnit5 has removed the @Rule notation. I wonder how that might affect this?

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Aug 1, 2016

Member

@djangofan I havn't researched JUnit5 yet. I guess they will provide some migration guide.

Member

asolntsev commented Aug 1, 2016

@djangofan I havn't researched JUnit5 yet. I guess they will provide some migration guide.

asolntsev added a commit that referenced this issue Aug 3, 2016

Fixes #364 #303 class SimpleReport is now thread-safe
it doesn't hold a single instance of EventsCollector, but creates a new one for every thread

asolntsev added a commit that referenced this issue Aug 3, 2016

Fixes #364 #303 class SoftAsserts is now thread-safe
it doesn't hold a single instance of ErrorsCollector, but creates a new one for every test
@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Aug 3, 2016

Member

@ken-p It should be fixed now. Will release version 3.8 soon.

Member

asolntsev commented Aug 3, 2016

@ken-p It should be fixed now. Will release version 3.8 soon.

@asolntsev asolntsev closed this Aug 3, 2016

asolntsev added a commit that referenced this issue Aug 4, 2016

@ken-p

This comment has been minimized.

Show comment
Hide comment
@ken-p

ken-p Aug 16, 2016

Thanks!!

ken-p commented Aug 16, 2016

Thanks!!

BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016

Fixes #364 #303 class SimpleReport is now thread-safe
it doesn't hold a single instance of EventsCollector, but creates a new one for every thread

BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016

Fixes #364 #303 class SoftAsserts is now thread-safe
it doesn't hold a single instance of ErrorsCollector, but creates a new one for every test

BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment