test: bump the timeout for test-execute subtests if running w/ QEMU
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 5 Mar 2024 12:24:18 +0000 (13:24 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 5 Mar 2024 18:50:14 +0000 (18:50 +0000)
Bump the timeout for test-execute subtests if running with plain QEMU
(as part of TEST-02-UNITTESTS), since we might start hitting the default
2m timeout with some more involved subtests, especially when the AWS
region we're running in is under heavy load. I see this regularly in the
CentOS Stream 9 nightly cron job with exec-dynamicuser-statedir.service
which has a lot of ExecStart's.

src/test/test-execute.c

index 6a574b495f1b610e07bec9c4a401dfe888335a96..76659fe0717107c223c0848de17b97ecb032576e 100644 (file)
@@ -61,6 +61,11 @@ static void wait_for_service_finish(Manager *m, Unit *unit) {
         assert_se(m);
         assert_se(unit);
 
+        /* Bump the timeout when running in plain QEMU, as some more involved tests might start hitting the
+         * default 2m timeout (like exec-dynamicuser-statedir.service) */
+        if (detect_virtualization() == VIRTUALIZATION_QEMU)
+                timeout *= 2;
+
         service = SERVICE(unit);
         printf("%s\n", unit->id);
         exec_context_dump(&service->exec_context, stdout, "\t");