Commit cb50990b authored by Klaus Aehlig's avatar Klaus Aehlig

Increase waiting time to avoid races

In tests, give Ganeti enough time to actually start up jobs before
asserting that they succeed. While normally forking and executing
a job is finished in less than a second in some circumstances it
can take longer; so give enough time to avoid flaky tests.

While there, also pause the watcher, so that it doesn't submit
jobs inbetween that cause our 0.01 second delay jobs to take
longer while waiting for locks taken by the watcher's jobs.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 853a4fb2
......@@ -277,6 +277,8 @@ def TestFilterAcceptPause():
and that the ACCEPT filter immediately allows starting.
"""
AssertCommand(["gnt-cluster", "watcher", "pause", "600"])
# Add a filter chain that pauses all new jobs apart from those with a
# specific reason.
# When the pausing filter is deleted, paused jobs must be continued.
......@@ -310,7 +312,7 @@ def TestFilterAcceptPause():
"0.01",
]))
time.sleep(0.5) # give some time to get queued
time.sleep(5) # give some time to get queued
AssertStatusRetry(jid1, "queued") # job should be paused
AssertStatusRetry(jid2, "success") # job should not be paused
......@@ -320,8 +322,11 @@ def TestFilterAcceptPause():
AssertCommand(["gnt-filter", "delete", uuid2])
# Now the paused job should run through.
time.sleep(5)
AssertStatusRetry(jid1, "success")
AssertCommand(["gnt-cluster", "watcher", "continue"])
def TestFilterRateLimit():
"""Tests that the RATE_LIMIT filter does reject new jobs when all
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment