On Mon, May 18, 2015 at 02:46:48PM +0200, 'Klaus Aehlig' via ganeti-devel wrote:
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: Klaus Aehlig <[email protected]>
---
qa/qa_filters.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/qa/qa_filters.py b/qa/qa_filters.py
index 3bede89..0de7594 100644
--- a/qa/qa_filters.py
+++ b/qa/qa_filters.py
@@ -376,18 +376,18 @@ def TestAdHocReasonRateLimit():
  # Only the first 2 jobs must be scheduled.
  jid1 = int(stdout_of([
    "gnt-debug", "delay", "--print-jobid", "--submit",
-    "--reason=rate-limit:2:hello", "20",
+    "--reason=rate-limit:2:hello", "200",
  ]))
  jid2 = int(stdout_of([
    "gnt-debug", "delay", "--print-jobid", "--submit",
-    "--reason=rate-limit:2:hello", "20",
+    "--reason=rate-limit:2:hello", "200",
  ]))
  jid3 = int(stdout_of([
    "gnt-debug", "delay", "--print-jobid", "--submit",
-    "--reason=rate-limit:2:hello", "20",
+    "--reason=rate-limit:2:hello", "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")
--
2.2.0.rc0.207.ga3a616c


LGTM

Reply via email to