Fix races in timer trigger tests.
Timer trigger tests are vulnerable to a race where the timer trigger can
enqueue new builds while we are checking the number of builds queued.
This can happen during intermediate build queue checks or in
assertFinalState.
To fix this race swap in a layout that does not use the timer trigger
which will prevent further build queueing once the timer triggered
builds have done their thing.
Change-Id: Ic9b64e34c6a39275b57b1299b47d9b1d0e0e5c79
diff --git a/tests/fixtures/layout-idle.yaml b/tests/fixtures/layout-idle.yaml
index e4574fa..0870788 100644
--- a/tests/fixtures/layout-idle.yaml
+++ b/tests/fixtures/layout-idle.yaml
@@ -8,5 +8,5 @@
projects:
- name: org/project
periodic:
- - project-test1
- - project-test2
+ - project-bitrot-stable-old
+ - project-bitrot-stable-older
diff --git a/tests/fixtures/layout-no-timer.yaml b/tests/fixtures/layout-no-timer.yaml
new file mode 100644
index 0000000..9436821
--- /dev/null
+++ b/tests/fixtures/layout-no-timer.yaml
@@ -0,0 +1,14 @@
+pipelines:
+ - name: periodic
+ manager: IndependentPipelineManager
+ # Trigger is required, set it to one that is a noop
+ # during tests that check the timer trigger.
+ trigger:
+ gerrit:
+ - event: patchset-created
+
+projects:
+ - name: org/project
+ periodic:
+ - project-bitrot-stable-old
+ - project-bitrot-stable-older
diff --git a/tests/fixtures/layout-timer-smtp.yaml b/tests/fixtures/layout-timer-smtp.yaml
index ac59df4..b5a6ce0 100644
--- a/tests/fixtures/layout-timer-smtp.yaml
+++ b/tests/fixtures/layout-timer-smtp.yaml
@@ -3,7 +3,7 @@
manager: IndependentPipelineManager
trigger:
timer:
- - time: '* * * * * */10'
+ - time: '* * * * * */1'
success:
smtp:
to: alternative_me@example.com
diff --git a/tests/fixtures/layout-timer.yaml b/tests/fixtures/layout-timer.yaml
index 9e0f66b..4904f87 100644
--- a/tests/fixtures/layout-timer.yaml
+++ b/tests/fixtures/layout-timer.yaml
@@ -15,7 +15,7 @@
manager: IndependentPipelineManager
trigger:
timer:
- - time: '* * * * * */10'
+ - time: '* * * * * */1'
projects:
- name: org/project