Skip to content

Commit 01d11e7

Browse files
committed
contest: vm: rework the subsequent VM launch delay
We wait for system to calm down before launching VMs, this is primarily meant as a way to avoid launching tests while other trees are still building their kernel. However, the placement of the delay means that it delays every single virtual machine launch. This makes the "thread_spawn_delay" kinda pointless as it does the same thing. Rework the logic a little bit. Have "thread_spawn_delay" as a single long wait / delay before we launch the _first_ additional VM. Lower the wait ival for the loadavg check for the extra VMs. This should let us set the initial wait longer to let the smaller test sets finish before we start kicking off extra workers for larger sets. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bb9bc15 commit 01d11e7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

contest/remote/vmksft-p.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import datetime
55
import shutil
6-
import fcntl
76
import os
87
import re
98
import queue
@@ -333,16 +332,21 @@ def test(binfo, rinfo, cbarg):
333332
# In case we have multiple tests kicking off on the same machine,
334333
# add optional wait to make sure others have finished building
335334
load_tgt = config.getfloat("cfg", "wait_loadavg", fallback=None)
335+
load_ival = config.getfloat("cfg", "wait_loadavg_ival", fallback=30)
336336
thr_cnt = int(config.get("cfg", "thread_cnt"))
337337
delay = float(config.get("cfg", "thread_spawn_delay", fallback=0))
338+
338339
for i in range(thr_cnt):
339-
wait_loadavg(load_tgt)
340+
# Lower the wait for subsequent VMs
341+
if i == 1:
342+
time.sleep(delay)
343+
load_ival /= 2
344+
wait_loadavg(load_tgt, check_ival=load_ival)
340345
print("INFO: starting VM", i)
341346
threads.append(threading.Thread(target=vm_thread,
342347
args=[config, results_path, i, hard_stop,
343348
in_queue, out_queue]))
344349
threads[i].start()
345-
time.sleep(delay)
346350

347351
for i in range(thr_cnt):
348352
threads[i].join()

0 commit comments

Comments
 (0)