Jbehave taking more time(15-20 minutes) for test execution start-up
Description
Attachments
- 21 Dec 2018, 01:32 AM
- 21 Dec 2018, 01:32 AM
Activity
Valery Yatsynovich December 26, 2018 at 7:13 AM
@Rakesh Vardan, I think you need to profile creation of performable stories to identify actual bottleneck. The provided timing is not enough, since it shows slowness, but it doesn't show where it happens. Another option is to provide project example to reproduce the issue.
Rakesh Vardan December 25, 2018 at 6:48 PMEdited
@Valery Yatsynovich, We could observe that the delay is in the 'addStories()' method in 'PerformableTree' class.
For each story the flow is traversing from PerformableTree -> addStories -> loop here for each story -> performableStory -> performableScenario -> addExampleScenario/useNormalScenario
And the result of which is added to the below map.
private Map<String, PerformableTree.PerformableStory> stories = new LinkedHashMap();
I tested this with a count of 270+ stories. From the below log we can identify that it took around 12+ min to create the map before which actual test execution started.
[INFO] Properties location [config/environments/${env}/mtaf-jbehave-tools.properties] not resolvable: class path resource [config/environments/qa2/mtaf-jbehave-tools.properties] cannot be opened because it does not exist
[INFO] JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[main] 25 Dec 2018 11:51:27,938 INFO : com.mastercard.quality.engineering.mtaf.jbehave.configuration.MastercardJBehaveStories - Creating bean Format[]
[main] 25 Dec 2018 11:51:27,960 INFO : com.mastercard.quality.engineering.mtaf.jbehave.configuration.MastercardJBehaveStories - Creating bean Format[]
[main] 25 Dec 2018 11:51:27,961 INFO : com.mastercard.testing.gdp.api.stories.GdpRestStories - We are using the story timeout period of 7200 seconds.
[INFO] Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4972ed7f: startup date Tue Dec 25 11:51:27 CST 2018; root of context hierarchy
[INFO] Properties location [config/environments/${env}/mtaf-jbehave-tools.properties] not resolvable: class path resource [config/environments/qa2/mtaf-jbehave-tools.properties] cannot be opened because it does not exist
[INFO] JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[INFO] Running embeddable com.mastercard.testing.gdp.api.stories.GdpRestStories
[INFO] Processing system properties {java.awt.headless=true}
[INFO] System property 'java.awt.headless' set to 'true'
[INFO] Using controls UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeouts=7200,threads=1,failOnStoryTimeout=false]]
[INFO] Connection object is 1354656260, URL=jdbcostgresql://ech-10-157-148-129.mastercard.int:5432/postgres?currentSchema=gdp_owner, UserName=postgres, PostgreSQL Native Driver
[INFO] Running story stories/B2B/F45858_B2B_Email_Templates/S368726_S368721_B2B_Email_Templates.story
[pool-2-thread-1] 25 Dec 2018 12:03:32,429 INFO : com.mastercard.quality.engineering.mtaf.jbehave.reporters.LoggingStoryReporter - =====================================================
[pool-2-thread-1] 25 Dec 2018 12:03:32,441 INFO : com.mastercard.quality.engineering.mtaf.jbehave.reporters.LoggingStoryReporter - Begin Story: S368726_S368721_B2B_Email_Templates.story
Please help.
Valery Yatsynovich December 21, 2018 at 10:32 AM
@Rakesh Vardan, the provided logs don't give much information:
they are overloaded with irrelevant data
they don't show actual timings
Rakesh Vardan December 21, 2018 at 1:30 AM
Apologies for delayed response.
Attached the logs. Please search with 'DELAYED EXECUTION' in the logs file to see where the delay is there. Kindly suggest if we need to modify any config.
Valery Yatsynovich December 12, 2018 at 12:19 PM
Please provide logs
JBehave Version 4.1.3
UI Test suite Details:
Currently, we have around 200+ story files containing 2000+ scenarios. Most of the scenarios may have about 5-6 steps. Each story file is annotated with Meta tags something like below:
StoryFile1.story:
Meta:
@regression
@aob
@documentSummary
StoryFile2.story:
Meta:
@regression
@abc
@others
Using Maven as the build tool.
Issue
We are executing our regression tests using meta filters as below:
-DmetaFilters=+aob
-DmetaFilters=+smoke
-DmetaFilters=+abc
etc.
As per our observation when the stories with the given meta tag are more(20+), jbehave is taking more time(20+ minutes) to start the test execution. Whereas if the count is less execution starts immediately.
Any idea if this is a known limitation? Or any workaround is there for us to mitigate this issue.
We could provide any logs if requested.
Thank you in advance for your suggestions.