Is it possible to limit the number of parallel workflows / workers for non-main branch pushes?

Hi,

we have a temporary situation when we cannot run our E2E tests in parallel. But it is important to run the E2E tests before merging the PR.

Is it possible to limit the number of parallel workers / workflows running to 1, so if the new PR will be opened while the E2E tests are still running for the previous one, the workflow for the new PR will be queued rather than executed in parallel?

We had to use the manual step for now, so the button should be pressed by the developer to start the tests, which requires the person to keep that in mind and check if no tests are running at the moment.

We expect to resolve the issue in the next month or two but for now it’s quite noticeable inconvenience factor in our DX.

Hi @zubko,

I remember having a similar requirement. There may not be a out of the box solution to this, but one way to achieve this is to have a file in your repo that tracks the current test job workflow id. At the beginning of your test job, use the circleci api to check the status of the workflow and wait till it completes. At the end of your test job, update the file that tracks the current workflow id and cache it. To read this value your job would need to have a restore cache step at the beginning, before it begins the polling mechanism. Hope this helps.

Cheers.