@@ -406,30 +406,36 @@ def test_015_dvm_run_preload_race_more(self):
406406
407407 async def _test_preload_wait_pause (self , preload_max ):
408408 """Waiting for pause avoids objects leaking."""
409- for _ in range (100 ):
409+ for _ in range (60 ):
410410 if len (self .disp_base .get_feat_preload ()) == preload_max :
411411 break
412412 await asyncio .sleep (1 )
413413 else :
414414 self .fail ("didn't preload in time" )
415- last_disp_name = self .disp_base .get_feat_preload ()[- 1 ]
416- last_disp = self .app .domains [last_disp_name ]
417- for _ in range (50 ):
418- if last_disp .is_paused ():
415+ preload_dispvm = self .disp_base .get_feat_preload ()
416+ preload_unfinished = preload_dispvm
417+ for _ in range (60 ):
418+ for qube in preload_unfinished .copy ():
419+ if self .app .domains [qube ].is_paused ():
420+ preload_unfinished .remove (qube )
421+ continue
422+ if not preload_unfinished :
419423 break
420424 await asyncio .sleep (1 )
421425 else :
422426 self .fail ("last preloaded didn't pause in time" )
423427
424-
425428 async def _test_015_dvm_run_preload_race_more (self ):
426429 # The limiting factor is how much memory is available on OpenQA and the
427430 # unreasonable memory allocated before the qube is paused due to:
428431 # https://github.com/QubesOS/qubes-issues/issues/9917
429- # Fedora 41, Whonix (Kicksecure) 17 fail with 4 preloaded qubes due to
430- # lack of memory. From the templates deployed by default, only Debian
431- # survives due to using less memory than the other OSes.
432- preload_max = 3
432+ # Whonix (Kicksecure) 17 fail more due to memory consumption. From the
433+ # templates deployed by default, only Debian and Fedora survives due to
434+ # using less memory than the other OSes.
435+ preload_max = 4
436+ os_dist = self .disp_base .features .check_with_template ("os-distribution" )
437+ if os_dist in ["whonix" , "kicksecure" ]:
438+ preload_max -= 1
433439 self .disp_base .features ["preload-dispvm-max" ] = str (preload_max )
434440 await self ._test_preload_wait_pause (preload_max )
435441 old_preload = self .disp_base .get_feat_preload ()
0 commit comments