Skip to content

Commit ef42f07

Browse files
committed
Remove threshold feature before tests
For: QubesOS/qubes-issues#1512
1 parent b267124 commit ef42f07

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

qubes/tests/integ/dispvm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ def cleanup_preload(self):
314314
)
315315
logger.info("deleting global feature")
316316
del self.app.domains["dom0"].features["preload-dispvm-max"]
317+
if "preload-dispvm-threshold" in self.app.domains["dom0"].features:
318+
logger.info("deleting global threshold feature")
319+
del self.app.domains["dom0"].features["preload-dispvm-threshold"]
317320
logger.info("end")
318321

319322
async def no_preload(self):
@@ -739,6 +742,10 @@ async def _test_019_preload_refresh(self):
739742
await self.wait_preload(preload_max)
740743
old_preload = self.disp_base.get_feat_preload()
741744
await qube.start()
745+
# If services are still starting, it may delay shutdown longer than
746+
# the default timeout. Because we can't just kill default
747+
# templates, wait gracefully for system services to have started.
748+
qube.run_service_for_stdio("qubes.WaitForRunningSystem")
742749
logger.info("shutdown '%s'", qube.name)
743750
await qube.shutdown(wait=True)
744751
await self.wait_preload(preload_max)

tests/dispvm_perf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,12 @@ def run_test(self, test: TestConfig):
528528
f"{nogui_prefix} {target} allow\n"
529529
)
530530
if test.preload_max:
531+
orig_preload_threshold = self.dom0.features.get(
532+
"preload-dispvm-threshold"
533+
)
531534
orig_preload_max = self.dom0.features.get("preload-dispvm-max")
535+
if orig_preload_threshold is not None:
536+
del self.dom0.features["preload-dispvm-threshold"]
532537
if orig_preload_max is not None:
533538
del self.dom0.features["preload-dispvm-max"]
534539
try:
@@ -552,6 +557,10 @@ def run_test(self, test: TestConfig):
552557
old_preload = old_preload.split(" ") or []
553558
del self.dvm.features["preload-dispvm-max"]
554559
self.wait_for_dispvm_destroy(old_preload)
560+
if orig_preload_threshold is not None:
561+
self.dom0.features["preload-dispvm-threshold"] = (
562+
orig_preload_threshold
563+
)
555564
if orig_preload_max is not None:
556565
self.dom0.features["preload-dispvm-max"] = orig_preload_max
557566
if orig_preload_max != 0:

0 commit comments

Comments
 (0)