You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for this amazing project. I have been using it in my company and we did over 1k e2e tests across multiple projects having no issues.
Since our integration tests suite grew considerably, we wanted to run them in parallel to avoid pipelines running for hours.
What are you trying to achieve?
Running BDD features in parallel and getting the correct amount of fails and success.
What do you get instead?
In the picture below, all the tests passed, but after checking the report I saw that there were 3 failed tests all of them in the background steps.
Running the tests with npx codeceptjs run-workers 4 --reporter mocha-multi --verbose I get the following output:
Digging deep into the code I traced the problem to codeceptjs/lib/command/workers/runTests.js
When sendToParentThread, there is a method called simplifyTest but it only handles the err object to be sent if there is a property err in the test object passed. The issue happens when an actual err is passed with a funcion in it, and the test contains no err property.
postMessage documentation gives a clear definition about what can or cannot be sent to a worker:
postMessage accept only value or JavaScript object handled by the structured clone algorithm, which includes cyclical references.
Looking at the structured clone algorithm, it accepts:
All primitive types (However, not symbols), Boolean object, String object, Date, RegExp (The lastIndex field is not preserved.), Blob, File, FileList, ArrayBuffer, ArrayBufferView (This basically means all typed arrays like Int32Array etc.), ImageBitmap, ImageData, Array, Object (This just includes plain objects (e.g. from object literals)), Map, Set
What it does not accept
Error and Function objects cannot be duplicated by the structured clone algorithm; attempting to do so will throw a DATA_CLONE_ERR exception.
Trying to fix the problem and adding the handler for err objects passed like this works partially and we start getting tests that fail in the background hooks.
I would love to make a PR with this change but I understand this is probably a core change that would probably have some other implications that I can't anticipate
The text was updated successfully, but these errors were encountered:
I am sorry i didnt have time earlier to look into this. Sure, any PR is welcome, better to start discussion as a part of PR, it helps to dive into context
First of all, thank you for this amazing project. I have been using it in my company and we did over 1k e2e tests across multiple projects having no issues.
Since our integration tests suite grew considerably, we wanted to run them in parallel to avoid pipelines running for hours.
What are you trying to achieve?
Running BDD features in parallel and getting the correct amount of fails and success.
What do you get instead?
In the picture below, all the tests passed, but after checking the report I saw that there were 3 failed tests all of them in the background steps.
Running the tests with npx codeceptjs run-workers 4 --reporter mocha-multi --verbose I get the following output:
Details
Edit 27/04
Digging deep into the code I traced the problem to codeceptjs/lib/command/workers/runTests.js
When sendToParentThread, there is a method called simplifyTest but it only handles the err object to be sent if there is a property err in the test object passed. The issue happens when an actual err is passed with a funcion in it, and the test contains no err property.
postMessage documentation gives a clear definition about what can or cannot be sent to a worker:
Looking at the structured clone algorithm, it accepts:
What it does not accept
Trying to fix the problem and adding the handler for err objects passed like this works partially and we start getting tests that fail in the background hooks.
I would love to make a PR with this change but I understand this is probably a core change that would probably have some other implications that I can't anticipate
The text was updated successfully, but these errors were encountered: