
Answer-first summary for fast verification
Answer: Create a new Cloud Spanner instance for every build. Load the required data. Delete the Cloud Spanner instance after the test is run.
To prevent performance test interference when multiple commits trigger concurrent runs, each test needs an isolated Cloud Spanner environment. Option B is correct because creating a new Cloud Spanner instance per build ensures isolation. Each instance can be configured with the required data and deleted post-test, avoiding concurrency issues. While creating a new project (Option A) also isolates resources, it introduces project creation overhead and quota limitations. Option C fails to handle concurrent tests as using the same instance risks data interference. Option D is unsuitable because the Cloud Spanner emulator isn't designed for accurate performance testing and isn't feasible in Cloud Build's cloud environment.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you implement automated performance testing in Cloud Build for each commit to prevent Cloud Spanner performance regressions, while handling potential concurrent test executions from multiple simultaneous commits?
A
Create a new project with a random name for every build. Load the required data. Delete the project after the test is run.
B
Create a new Cloud Spanner instance for every build. Load the required data. Delete the Cloud Spanner instance after the test is run.
C
Create a project with a Cloud Spanner instance and the required data. Adjust the Cloud Build build file to automatically restore the data to its previous state after the test is run.
D
Start the Cloud Spanner emulator locally. Load the required data. Shut down the emulator after the test is run.
No comments yet.