From a1f5a47b60d119859d974bed4d66db745448aac6 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 23 Jan 2024 12:03:53 +0100 Subject: tests/qtest: Bump timeout of the boot-serial-test to 360 seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the slow k8s CI runner, the test sometimes takes more than 240 seconds. See for example this run here where it took ~ 267 seconds: https://gitlab.com/qemu-project/qemu/-/jobs/5806087027#L4769 Thus we have to bump the timeout here even further to be on the safe side. Let's use 360 seconds which should hopefully really be high enough now. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2097 Message-ID: <20240123110353.30658-1-thuth@redhat.com> Reviewed-by: "Daniel P. Berrangé" Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index d22434b..d22aec6 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -9,7 +9,7 @@ slow_qtests = { 'test-hmp' : 240, 'pxe-test': 600, 'prom-env-test': 360, - 'boot-serial-test': 240, + 'boot-serial-test': 360, 'qos-test': 120, } -- cgit v1.1 From e2c41766a9ad05b608671119661e4d8b7f53e5a2 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 22 Jan 2024 16:33:47 +0100 Subject: tests/unit/test-iov: Fix timeout problem on NetBSD and OpenBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test-iov code uses usleep() with small values (<= 30) in some nested loops with many iterations. This causes a small delay on OSes like Linux that have a precise sleeping mechanism, but on systems like NetBSD and OpenBSD, each usleep() call takes multiple microseconds, which then sum up in a total test time of multiple minutes! Looking at the code, the usleep() does not really seem to be necessary here - if not enough data could be send, we should simply always use select() to wait 'til we can send more. Thus remove the usleep() and re-arrange the code a little bit to make it more clear what is going on here. Suggested-by: "Daniel P. Berrangé" Message-ID: <20240122153347.71654-1-thuth@redhat.com> Reviewed-by: "Daniel P. Berrangé" Signed-off-by: Thomas Huth --- tests/unit/test-iov.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/unit/test-iov.c b/tests/unit/test-iov.c index 6f7623d..75bc3be 100644 --- a/tests/unit/test-iov.c +++ b/tests/unit/test-iov.c @@ -197,15 +197,17 @@ static void test_io(void) s = g_test_rand_int_range(0, j - k + 1); r = iov_send(sv[1], iov, niov, k, s); g_assert(memcmp(iov, siov, sizeof(*iov)*niov) == 0); - if (r >= 0) { - k += r; - usleep(g_test_rand_int_range(0, 30)); - } else if (errno == EAGAIN) { - select(sv[1]+1, NULL, &fds, NULL, NULL); - continue; - } else { - perror("send"); - exit(1); + if (r < 0) { + if (errno == EAGAIN) { + r = 0; + } else { + perror("send"); + exit(1); + } + } + k += r; + if (k < j) { + select(sv[1] + 1, NULL, &fds, NULL, NULL); } } while(k < j); } -- cgit v1.1 From 4dfa7dc2ac07c3599da97fa9e0588ceac097b3e5 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 24 Jan 2024 09:44:12 +0100 Subject: tests/qtest: Bump timeouts of boot_sector_test()-based tests to 610 seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We're still seeing timeouts in qtests that use a TCG payload with TCI on a slow k8s runner: https://gitlab.com/qemu-project/qemu/-/jobs/5990992722 So we should bump the timeout of cdrom-test to see whether that fixes the issue. Now, cdrom-test, as bios-tables-test, pxe-test and vmgenid-test use the boot_sector_test() function for running a TCG payload. That function already uses an internal timeout of 600 seconds with the remark that the test could be slow with TCI. Thus from the outer meson test runner side, we should not use less than 600 seconds as timeout values for these tests. Let's bump them on the meson side to 610 seconds so that the tests themselves can run with their internal 600 seconds timeout and have some additional seconds on top for reporting the outcome. Message-ID: <20240124084412.465638-1-thuth@redhat.com> Reviewed-by: "Daniel P. Berrangé" Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index d22aec6..84a055a 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,16 +1,18 @@ slow_qtests = { 'aspeed_smc-test': 360, - 'bios-tables-test' : 540, + 'bios-tables-test' : 610, + 'cdrom-test' : 610, 'device-introspect-test' : 720, 'migration-test' : 480, 'npcm7xx_pwm-test': 300, 'npcm7xx_watchdog_timer-test': 120, 'qom-test' : 900, 'test-hmp' : 240, - 'pxe-test': 600, + 'pxe-test': 610, 'prom-env-test': 360, 'boot-serial-test': 360, 'qos-test': 120, + 'vmgenid-test': 610, } qtests_generic = [ -- cgit v1.1