Closed magarwal19 closed 2 months ago
I can't help you without a way of reproducing this.
it would be for any code if we run it using cypress dashboard parallel..
it is not code related part but more like when we run it on parallel thread using CI and Dashboard..
we can try to run any code with this setup to reproduce issue
If it can be reproduced using any code, then that is what you should provide. A runnable example which showcases the error. In no way am I interested in your production code, as explained in the contributing guidelines.
if possible can you please check this link https://davidwcai.medium.com/fix-cypress-invalid-or-unexpected-token-errors-in-parallel-runs-e887d7efa945 and suggest changes which can be done for config js file?
i currently have code :
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor"); const { addCucumberPreprocessorPlugin, } = require("@badeball/cypress-cucumber-preprocessor"); const { createEsbuildPlugin, } = require("@badeball/cypress-cucumber-preprocessor/esbuild");
on( "file:preprocessor", createBundler({ plugins: [createEsbuildPlugin(config)], }) );
If it can be reproduced using any code, then that is what you should provide. A runnable example which showcases the error. In no way am I interested in your production code, as explained in the contributing guidelines.
I understand it, but my part is even though i will share a sample code, this issue will not be reproducible on local run..
as this will only be reproducible when we run on parallel agent over CI/CD and using cypress dashboard
You need to figure out what you're doing different in CI vs. local.
For instance, using Cypress Cloud to parallelize isn't exclusive to CI. You can run that stuff locally. If you haven't, then you're essentially running two different programs and wondering why the results aren't the same.
Sorry, but as per my knowledge, cypress does not support parallel execution on local.. we can achieve parallel run using dashboard when we have multiple agents/nodes executing over CI https://docs.cypress.io/guides/cloud/smart-orchestration/parallelization
would be happy to know if there is a way to run tests in parallel in cypress on local machine
CI isn't special in this regard, you just run $ cypress run --record --key=abc123 --parallel
, as per the mentioned docs, on your local machine, possibly simultaneously.
issue is same as it is mentioned in https://davidwcai.medium.com/fix-cypress-invalid-or-unexpected-token-errors-in-parallel-runs-e887d7efa945
since we are executing parallel, different threads try to overwrite same data, due which it fails...
i am not able to use the solution given in this link, but able to resolve issue for me by adding manual waits of 15seconds for each parallel run
Okey. Closing as not an issue with the preprocessor.
sorry but it is issue with preprocessor only when we are executing in parallel, we might need to update the code where we are creating file conversion to use uuid
This preprocessor doesn't touch the filesystem during compile stage. The above-mentioned article explains the issue without referencing this preprocessor at all, further indicating that this isn't my problem.
Current behavior
When i execute tests using parallel execution from CI, then some random tests are failing due to errors
while executing tests in local sequentially then no issue is observed.
I was going through few links and seems this might be due to parallel behaviour
https://davidwcai.medium.com/fix-cypress-invalid-or-unexpected-token-errors-in-parallel-runs-e887d7efa945
Note: I am using JS based solution for cypress
Desired behavior
Error messages should not be thrown and we should be able to execute tests in parallel
Test code to reproduce
Sorry can not share the code directly
Versions