Run test fail on arm64
babelouest opened this issue · 2 comments
babelouest commented
Hello,
During the Debian package build 1.5.1-1, the test fail for architecture arm64.
The error log is quite large, but there seems to be at least this error:
test/check_openidc.c:941:F:core:test_openidc_handle_cache:0: Assertion 'oauth2_http_response_status_code_get(_log, response) == 0' failed: oauth2_http_response_status_code_get(_log, response) == 302, 0 == 0
You can find the full build log here: https://buildd.debian.org/status/fetch.php?pkg=liboauth2&arch=arm64&ver=1.5.1-1&stamp=1687716199&raw=0
Any clue what it might be?
zandbelt commented
thanks for reporting; it looks like a timing issue, could you please try with the following patch:
diff --git a/test/check_openidc.c b/test/check_openidc.c
index de524ec..e7fc228 100644
--- a/test/check_openidc.c
+++ b/test/check_openidc.c
@@ -952,7 +952,7 @@ static void _test_openidc_handle(oauth2_cfg_openidc_t *c)
oauth2_http_request_free(_log, r);
oauth2_http_response_free(_log, response);
- sleep(2);
+ sleep(3);
r = oauth2_http_request_init(_log);
rc = oauth2_http_request_path_set(_log, r, "/secure");
@@ -991,7 +991,7 @@ START_TEST(test_openidc_handle_cookie)
session_cfg = oauth2_cfg_session_init(_log);
oauth2_cfg_session_set_options(
_log, session_cfg, "cookie",
- "name=short_cookie&inactivity_timeout=1");
+ "name=short_cookie&inactivity_timeout=2");
oauth2_cfg_openidc_provider_resolver_set_options(
_log, c, "string", test_openidc_metadata_get(),
@@ -1028,7 +1028,7 @@ START_TEST(test_openidc_handle_cache)
session_cfg = oauth2_cfg_session_init(_log);
oauth2_cfg_session_set_options(
_log, session_cfg, "cache",
- "name=short_memory&cache=memory&inactivity_timeout=1");
+ "name=short_memory&cache=memory&inactivity_timeout=2");
oauth2_cfg_openidc_provider_resolver_set_options(
_log, c, "string", test_openidc_metadata_get(),
babelouest commented
It seems to work with the patch: https://buildd.debian.org/status/package.php?p=liboauth2&suite=experimental
I'll apply it to unstable then, thanks!