Test timeout fixes and URI code clean up
Hi Peter!
The following changes since commit 09be34717190c1620f0c6e5c8765b8da354aeb4b:
Merge tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu into staging (2024-01-20 17:22:16 +0000)
are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/pull-request-2024-01-24
for you to fetch changes up to e7b991451eecb58af34d6d3d17209e97f5e97f96:
util/uri: Remove unused macros ISA_RESERVED() and ISA_GEN_DELIM() (2024-01-24 09:54:05 +0100)
----------------------------------------------------------------
* Test timeout fixes
* Clean up URI code
----------------------------------------------------------------
Thomas Huth (7):
tests/qtest: Bump timeout of the boot-serial-test to 360 seconds tests/unit/test-iov: Fix timeout problem on NetBSD and OpenBSD tests/qtest: Bump timeouts of boot_sector_test()-based tests to 610 seconds util/uri: Remove uri_string_unescape()
util/uri: Remove unused functions uri_resolve() and uri_resolve_relative() util/uri: Remove the uri_string_escape() function
util/uri: Remove unused macros ISA_RESERVED() and ISA_GEN_DELIM()
include/qemu/uri.h | 4 - tests/unit/test-iov.c | 20 +- util/uri.c | 869 +----------------------------------------------- tests/qtest/meson.build | 8 +- 4 files changed, 27 insertions(+), 874 deletions(-)
[PULL 4/7] util/uri: Remove uri_string_unescape()
uri_string_unescape() basically does the same as the glib function g_uri_unescape_segment(). So we can get rid of our implementation completely by simply using the glib function instead.
Message-ID: <[email protected]>
--- include/qemu/uri.h | 1 - util/uri.c | 97 ++++++---------------------------------------- 2 files changed, 11 insertions(+), 87 deletions(-)
include/qemu/uri.h +0 -1
@@ -79,7 +79,6 @@ URI *uri_parse_raw(const char *str, int raw);int uri_parse_into (URI *uri,const char *str);char *uri_to_string (URI *uri);char *uri_string_escape (const char *str,const char *list); -char *uri_string_unescape (const char *str,int len,char *target);void uri_free (URI *uri);/* Single web service query parameter 'name=value'. */
util/uri.c +11 -86
163 lines not on this page · raw message
Signature · 1 line
2.43.0
[PULL 2/7] tests/unit/test-iov: Fix timeout problem on NetBSD and OpenBSD
In reply to Thomas HuthThe 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.
Message-ID: <[email protected]>
--- tests/unit/test-iov.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
tests/unit/test-iov.c +11 -9
@@ -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); }
Signature · 1 line
2.43.0
[PULL 1/7] tests/qtest: Bump timeout of the boot-serial-test to 360 seconds
In reply to Thomas HuthOn 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: <[email protected]>
--- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/meson.build +1 -1
@@ -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, }
Signature · 1 line
2.43.0
[PULL 7/7] util/uri: Remove unused macros ISA_RESERVED() and ISA_GEN_DELIM()
In reply to Thomas HuthThey are not used anywhere, so there's no need to keep them around.
Message-ID: <[email protected]>
--- util/uri.c | 13 ------------- 1 file changed, 13 deletions(-)
util/uri.c +0 -13
@@ -163,19 +163,6 @@ static void uri_clean(URI *uri); ((*(p) =='+' )) || ((*(p) ==',' )) || ((*(p) ==';' )) || \ ((*(p) == '=')) || ((*(p) == '\''))) -/* -* gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" -*/ -#define ISA_GEN_DELIM (p) \ - (((*(p) == ':')) || ((*(p) == '/')) || ((*(p) == '?')) || \ - ((*(p) == '#')) || ((*(p) == '[')) || ((*(p) == ']')) || \ - ((*(p) == '@'))) - -/* -* reserved = gen-delims / sub-delims -*/ -#define ISA_RESERVED (p) (ISA_GEN_DELIM(p) || (ISA_SUB_DELIM(p))) -/* * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" */
Signature · 1 line
2.43.0
[PULL 5/7] util/uri: Remove unused functions uri_resolve() and uri_resolve_relative()
In reply to Thomas HuthThese rather complex functions have never been used since they've been introduced in 2012, so looks like they are not really useful for QEMU. And since the static normalize_uri_path() function is also only used by uri_resolve(), we can remove that function now, too.
Message-ID: <[email protected]>
--- include/qemu/uri.h | 2 - util/uri.c | 689 --------------------------------------------- 2 files changed, 691 deletions(-)
include/qemu/uri.h +0 -2
@@ -72,8 +72,6 @@ typedef struct URI { }URI ;URI *uri_new (void ); -char *uri_resolve (const char *URI ,const char *base); -char *uri_resolve_relative (const char *URI ,const char *base);URI *uri_parse (const char *str);URI *uri_parse_raw (const char *str,int raw);int uri_parse_into (URI *uri,const char *str);
util/uri.c +0 -689
701 lines not on this page · raw message
Signature · 1 line
2.43.0
[PULL 3/7] tests/qtest: Bump timeouts of boot_sector_test()-based tests to 610 seconds
In reply to Thomas HuthWe'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: <[email protected]>
--- tests/qtest/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/qtest/meson.build +4 -2
@@ -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 = [
Signature · 1 line
2.43.0
[PULL 6/7] util/uri: Remove the uri_string_escape() function
In reply to Thomas HuthNow that uri_resolve_relative() has been removed, this function is not used in QEMU anymore - and if somebody needs this functionality, they can simply use g_uri_escape_string() from the glib instead.
Message-ID: <[email protected]>
--- include/qemu/uri.h | 1 - util/uri.c | 70 ---------------------------------------------- 2 files changed, 71 deletions(-)
include/qemu/uri.h +0 -1
@@ -76,7 +76,6 @@ URI *uri_parse(const char *str);URI *uri_parse_raw (const char *str,int raw);int uri_parse_into (URI *uri,const char *str);char *uri_to_string (URI *uri); -char *uri_string_escape (const char *str,const char *list);void uri_free (URI *uri);/* Single web service query parameter 'name=value'. */
util/uri.c +0 -70
76 lines not on this page · raw message
Signature · 1 line
2.43.0
Peter Maydell
AppliedQuoted 11 lines · Thomas Huth
Hi Peter!
The following changes since commit
09be34717190c1620f0c6e5c8765b8da354aeb4b:Merge tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu into staging (2024-01-20 17:22:16 +0000)
are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/pull-request-2024-01-24
Quoted 8 lines
for you to fetch changes up to
e7b991451eecb58af34d6d3d17209e97f5e97f96:util/uri: Remove unused macros
ISA_RESERVED()andISA_GEN_DELIM()(2024-01-24 09:54:05 +0100)----------------------------------------------------------------
* Test timeout fixes
* Clean up URI code
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0
for any user-visible changes.
-- PMM