TestProject Forum

When dealing with consecutively queued deployments, best practices to go about test job executions that do not complete in time

Hello everyone,

My team has recently set up a working CI/CD pipeline for our project, which automates the process of deployment to our development site once code is checked in.

Now, upon successfully setting up a service hook on Azure DevOps which calls the TestProject API to run a job (which runs for about 30 mins). I have been facing an issue, the scenario described below:

  • Developer A and B checks in code about the same time, developer B’s code being queued.
  • Once developer A’s code has been processed and released to devsite, the service hook is triggered and test job begins executions.
  • Now the pipeline begins processing developer B’s code.
  • Assuming the job execution is still incomplete, the moment developer B’s code is deployed to the devsite, the devsite during rebuilding will be down for about 5 minutes, interrupting the test execution and resulting with a failure.

This is problematic as we are working on a billing system, where at the end of our job, the tests would include resetting the state of the database, which is required for the next job to run successfully. Any advice on the best practices to go about this issue?

Thanks, and appreciate any help =)

Hi @bthk2151,
Assuming your second build will always cause the concurrently running builds to fail due to failing TestProject jobs, I suggest checking every 10 seconds or so the following endpoint:
https://api.testproject.io/docs/v2/#/Executions/Executions_GetRunningExecutionsAsync
To make sure there are no currently running executions before starting the next build and thus forcing the application down.
This way you will verify that the previous executions have finished before rebuilding the environment.