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 =)