JBehave
  1. JBehave
  2. JBEHAVE-619

ParameterConverters throwing ConcurrentModificationException

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.1
    • Fix Version/s: 3.5.2, 3.6
    • Component/s: Core
    • Environment:
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      java.util.ConcurrentModificationException
      at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
      at java.util.AbstractList$Itr.next(AbstractList.java:343)
      at org.jbehave.core.steps.ParameterConverters.convert(ParameterConverters.java:116)
      at org.jbehave.core.steps.StepCreator.convertParameters(StepCreator.java:198)
      at org.jbehave.core.steps.StepCreator.access$800(StepCreator.java:27)
      at org.jbehave.core.steps.StepCreator$ParameterizedStep.parametriseStep(StepCreator.java:465)
      at org.jbehave.core.steps.StepCreator$ParameterizedStep.perform(StepCreator.java:424)
      at com.foobar.config.ScenarioBasedStoryRunner$FineSoFar.run(ScenarioBasedStoryRunner.java:443)
      at com.foobar.config.ScenarioBasedStoryRunner.runStepsWhileKeepingState(ScenarioBasedStoryRunner.java:429)
      at com.foobar.config.ScenarioBasedStoryRunner.runScenarioSteps(ScenarioBasedStoryRunner.java:393)
      at com.foobar.config.ScenarioBasedStoryRunner.runIt(ScenarioBasedStoryRunner.java:269)
      at com.foobar.config.ScenarioBasedStoryRunner.run(ScenarioBasedStoryRunner.java:185)
      at com.foobar.config.ScenarioBasedStoryRunner.run(ScenarioBasedStoryRunner.java:166)
      at org.jbehave.core.embedder.Embedder$EnqueuedStory.call(Embedder.java:594)
      at org.jbehave.core.embedder.Embedder$EnqueuedStory.call(Embedder.java:558)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)

        Activity

        Hide
        Jean d'Arc added a comment -

        Unable to determine the conditions that make this happen during CI builds running against selenium grid, however the following change makes the aforementioned test pass:

        private ParameterConverters(StepMonitor monitor, List<ParameterConverter> converters)

        { this.monitor = monitor; this.converters = new CopyOnWriteArrayList<ParameterConverter>(converters); }
        Show
        Jean d'Arc added a comment - Unable to determine the conditions that make this happen during CI builds running against selenium grid, however the following change makes the aforementioned test pass: private ParameterConverters(StepMonitor monitor, List<ParameterConverter> converters) { this.monitor = monitor; this.converters = new CopyOnWriteArrayList<ParameterConverter>(converters); }
        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.5.2 [ 17830 ]
        Hide
        Mauro Talevi added a comment -

        Hi Jean, added your contributed test to ConcurrencyBehaviour, but unable to reproduce the failure consistently - at least on JDK 1.5.

        Could you please try to verify if you can get it to fail?

        Show
        Mauro Talevi added a comment - Hi Jean, added your contributed test to ConcurrencyBehaviour, but unable to reproduce the failure consistently - at least on JDK 1.5. Could you please try to verify if you can get it to fail?
        Hide
        Mauro Talevi added a comment -

        Added optional boolean flag to trigger thread-safe mode, i.e. use of CopyOnWriteArrayList.

        Interestingly, the expected behaviour seems to be reproducable in IDE but not in command-line, where the ConcurrencyBehaviour tests pass regardless of the thread-safe flag.

        Show
        Mauro Talevi added a comment - Added optional boolean flag to trigger thread-safe mode, i.e. use of CopyOnWriteArrayList. Interestingly, the expected behaviour seems to be reproducable in IDE but not in command-line, where the ConcurrencyBehaviour tests pass regardless of the thread-safe flag.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.6 [ 17721 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Jean d'Arc
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: