Commit 43b45518 authored by Klaus Aehlig's avatar Klaus Aehlig

Avoid races in TestFilterRateLimit

The test submits 3 jobs in an environment rate-limited to two, and verifies
that the first 2 jobs are running whereas the third one remains queued. However,
it takes for Ganeti some time to get a submitted job to actually being confirmed
waiting (in some circumstances over a second). So wait a bit longer to avoid
losing the race. While there, increase the time of the delay jobs to avoid
them finishing during that test in an extremely slowly running QA. (Note that
the jobs are killed forcefully at the end of the test, so that time is never
really waited for.)
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 49598ac3
......@@ -342,16 +342,16 @@ def TestFilterRateLimit():
# Now only the first 2 jobs must be scheduled.
jid1 = int(stdout_of([
"gnt-debug", "delay", "--print-jobid", "--submit", "20"
"gnt-debug", "delay", "--print-jobid", "--submit", "200"
]))
jid2 = int(stdout_of([
"gnt-debug", "delay", "--print-jobid", "--submit", "20"
"gnt-debug", "delay", "--print-jobid", "--submit", "200"
]))
jid3 = int(stdout_of([
"gnt-debug", "delay", "--print-jobid", "--submit", "20"
"gnt-debug", "delay", "--print-jobid", "--submit", "200"
]))
time.sleep(0.1) # give the scheduler some time to notice
time.sleep(5) # give the scheduler some time to notice
AssertIn(GetJobStatus(jid1), ["running", "waiting"],
msg="Job should not be rate-limited")
......
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