Can we trigger multiple tests in parallel in pytest but with a little time difference

220 views Asked by At

I have created a pytest framework where each test triggers a Jenkins job to deploy some application and then perform some validation. (I am using pytest-jenkins module to trigger a Jenkins build from python) However, when I run these tests in parallel (using pytest-xdist -n auto), same Jenkins build gets triggered from 2-3 different tests which I don't want. So, I am looking for some option where tests are run in parallel but are triggered with a time gap of few seconds.. Note - As each test takes about an hour to complete, running them one after other is not good option for me.

As a temporary workaround, I have added some sleep time of 5 sec, 10 sec in each test so that when they are run in parallel, the Jenkins job gets triggered with a time gap.. But I am looking for some better solution. Thanks in advance!!

0

There are 0 answers