Improved interrupt/cancelation build tests
What does this MR do?
- Introduces
RunBuildWithCancel
, a test that allows us to test whether interrupts and cancelations are working during a build.
Why was this MR needed?
- The logic was previously copied/pasted to all executors.
- Most tests were behaving incorrectly: A delay of 1 second, for most executors, was not enough to cancel a context during a build.
- We're going to introduce another form of cancelation, and we need to test the behaviours between them: on some,
after_script
should be executed, and on others the build should immediately terminate.
What's the best way to test this MR?
Each executor has a *BuildCancel test, eg:
go test -v -count 1 -run TestDockerCommandBuildCancel ./executors/docker
What are the relevant issue numbers?
Edited by Arran Walker