-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Parallel Execution - SupportCodeLibraryBuilder Not Loaded with Externalised Hook Information #2327
Comments
Hey @tamil777selvan, sorry for the late reply. The support code loading for parallel is...a bit weird. We load it on the coordinator (from where we emit the messages about it) and then again on each worker (where the tests are actually going to be run). There's then a kind of sync process so they share the same ids in all places. So if you jump in via the builder and add a hook on the coordinator only, there'll be a mismatch and thing will break in the way that you've seen. I'm sure we can figure out a solution though. One of the things I've been looking at under the umbrella of Plugins is an extension point to prepend/append steps and hooks separate to the normal support code loading cycle. Also though, there might be other ways you can inject the behaviour you want besides a hook. Can you say a bit more about the use case that's driving this? |
Hi @davidjgoss, This scenario is particularly relevant when integrating WebdriverIO with Cucumber's parallel execution mechanism. When parallel execution is enabled, the WebdriverIO hooks invoked are not processed within the parallel coordinator, resulting in the observed issue. |
Could you say a bit more about what these hooks do? i.e. is it user-authored code, or more like wdio plumbing? If you were to put them in a file and add it to the (I suspect there is some overlap with #2156 here.) |
@davidjgoss, these codes are provided by users and are integrated into Cucumber hooks through the support code library within the For example, the This seems quite similar to the previous issue, as both cases involve the need to load custom hooks for parallel execution. |
Thanks for the detail! For this to work we have to find a way to have these user-authored hooks register on both the coordinator (parent) process and the worker processes. I assume we don't have this problem for steps because users are calling the Cucumber |
π What did you see?
Hooks that are loaded via
supportCodeLibraryBuilder
encounter an error when using the parallel option in therunCucumber
API.β What did you expect to see?
Hooks loaded through
supportCodeLibraryBuilder
should be properly initialised and accessible, even when parallel mode is enabled.π¦ Which tool/library version are you using?
Cucumber JS
- 9.5.1π¬ How could we reproduce it?
supportCodeLibraryBuilder
.BeforeAll
usingsupportCodeLibraryBuilder.methods.BeforeAll
.supportCodeLibraryBuilder
.Once you've completed the above setup, you can invoke
runCucumber
withparallel: 0
, and it should work as expected because it usesrunTime
.However, if you set
parallel: 1
, you will encounter the following error because it uses theparallel coordinator
.π Any additional context?
Code Snippet Used:
This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: