The following scenario arises: There has been a change to a unit. This should be verified using a unit test. After that, a procedural integration test follows. Could one not run the integration test in parallel with the unit test to save time? However, this entails a cost risk.
Why? If the unit test fails, the integration test becomes obsolete. Costs have been incurred for unusable results.
However, there is the option to reuse the instance for the unit test, thus saving the overhead, i.e., unproductive times of an instance: Before the end of the test run, the necessary data (software, test data, etc.) are cleverly loaded into the instance, and the execution of the integration test is initiated. At the same time, the results of the unit test are downloaded.
Of course, the question arises: If I am already downloading the results, how do I know if the test run was successful? The solution is to continuously monitor the running instance, as most results are already known before the end of the test. The risk is then low that an integration test starts while the previous unit test has failed.
In the end, the additional cost risk is close to zero.
This means: carefully examine and consider when the test results are truly needed.
Why use many instances to get test results within an hour when they are not needed at that time? For example: starting a test on Friday evening – at 6 PM – and the results are only needed on Monday.
In CI environments, test runs can be organized automatically. With the right strategy, planning, and a little patience, costs can be massively reduced, as seen in the use of long-term rentals.