Details
Description
A StackOverflowError occurs when the PatternScenarioParser parses a very long step in a scenario. This happened to us when writing a Given step that included a long table parameter.
This seems to be caused by the well-known regex bug in Java (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337993). The patternToPullOutSteps method specifies a pattern that contains an alternative wrapped in a star, specifically "(.|
s)*".
We were able to use the same strategy as that used to fix JBEHAVE-242.
One note about the included patch: the test we've added to PatternScenarioParserBehaviour, shouldParseStoryWithVeryLongStep, can sometimes pass incorrectly depending on the order in which the tests from that class are run. If shouldParseLongStoryWithKeywordSplitScenarios runs first, our test passes even without the fix applied. We weren't sure what to do about this, but on our machine the tests reliably ran in the order in which they were defined, so we just kept that one higher up in the file. Possibly there are deeper issues to consider here.
--Moss Collum and Jim Olsen
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Mauro Talevi [ maurotalevi ] | |
Fix Version/s | 2.5.7 [ 16500 ] | |
Fix Version/s | 3.0 [ 16302 ] | |
Component/s | Core [ 11086 ] |
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Thanks for the patch. Applied, tested and released in 2.5.7.