From 2d4d1747e94fdf1b314b75d70cedc0d14882e9f5 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 5 May 2024 22:15:56 +0200 Subject: [PATCH 1/5] test: suppress logging for buffer/add_file_leak1 Warnings from this test should be ignored: [warn] evbuffer_file_segment_materialize: mmap(5, 0, 0) failed: Invalid argument --- test/regress_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/regress_buffer.c b/test/regress_buffer.c index 32e35af8..26823c9a 100644 --- a/test/regress_buffer.c +++ b/test/regress_buffer.c @@ -2968,7 +2968,7 @@ struct testcase_t evbuffer_testcases[] = { { "file_segment_add_cleanup_cb", test_evbuffer_file_segment_add_cleanup_cb, 0, NULL, NULL }, { "pullup_with_empty", test_evbuffer_pullup_with_empty, 0, NULL, NULL }, #ifndef EVENT__DISABLE_MM_REPLACEMENT - { "add_file_leak1", test_evbuffer_add_file_leak1, 0, NULL, NULL }, + { "add_file_leak1", test_evbuffer_add_file_leak1, TT_NO_LOGS, NULL, NULL }, #endif #define ADDFILE_TEST(name, parameters) \ From d538f41f0a5e1b60549fae766eda1bdc965d6a44 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 5 May 2024 21:12:14 +0200 Subject: [PATCH 2/5] test: add debugging for bufferevent/bufferevent_connect_fail_eventcb* --- test/regress_bufferevent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/regress_bufferevent.c b/test/regress_bufferevent.c index c35127e6..48a666b6 100644 --- a/test/regress_bufferevent.c +++ b/test/regress_bufferevent.c @@ -750,8 +750,8 @@ end: static void reader_eventcb_simple(struct bufferevent *bev, short what, void *ctx) { - TT_BLATHER(("Read eventcb simple invoked on %d.", - (int)bufferevent_getfd(bev))); + TT_BLATHER(("Read eventcb simple invoked on %d (what=%hd).", + (int)bufferevent_getfd(bev), what)); n_events_invoked++; } From 479b5ed6f417c452b3da519d2b168f6424d3ecae Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 5 May 2024 21:30:01 +0200 Subject: [PATCH 3/5] test: fix printing number of retries for FAILED message --- test/tinytest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/tinytest.c b/test/tinytest.c index 9ad6a703..8f3b53dc 100644 --- a/test/tinytest.c +++ b/test/tinytest.c @@ -550,7 +550,8 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups) struct testgroup_t *group = &groups[i]; for (j = 0; group->cases[j].name; ++j) { struct testcase_t *testcase = &group->cases[j]; - int attempts = (testcase->flags & TT_RETRIABLE) ? opt_retries : 0; + int retriable = testcase->flags & TT_RETRIABLE; + int attempts = retriable ? opt_retries : 0; int test_ret_err; if (!(testcase->flags & TT_ENABLED_)) @@ -575,7 +576,8 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups) case OK: ++n_ok; break; case SKIP: ++n_skipped; break; default: - printf("\n [FAILED %s%s (%i retries)]\n", group->prefix, testcase->name, opt_retries); + printf("\n [FAILED %s%s (%i retries)]\n", + group->prefix, testcase->name, retriable ? opt_retries : 0); ++n_bad; break; } From ba97d94738a03d9d23618577644f7da9feefb389 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 5 May 2024 21:35:46 +0200 Subject: [PATCH 4/5] test: reset some static vars to avoid affecting other tests --- test/regress_bufferevent.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/regress_bufferevent.c b/test/regress_bufferevent.c index 48a666b6..fa908100 100644 --- a/test/regress_bufferevent.c +++ b/test/regress_bufferevent.c @@ -866,6 +866,10 @@ test_bufferevent_connect_fail_eventcb(void *arg) fake_listener = fake_listener_create(&localhost); + n_strings_read = 0; + n_reads_invoked = 0; + n_events_invoked = 0; + tt_int_op(n_events_invoked, ==, 0); bev = bufferevent_socket_new(data->base, -1, flags); From 0f51ba669a2686c3189141829b2de850d4c3f411 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 6 May 2024 09:10:15 +0200 Subject: [PATCH 5/5] test: mark http/timeout_read_server as retriable --- test/regress_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/regress_http.c b/test/regress_http.c index 0ca5dd75..c3c9ff41 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -6113,7 +6113,7 @@ struct testcase_t http_testcases[] = { HTTP_OPT(max_connections, SKIP_UNDER_WINDOWS), HTTP(timeout_read_client), - HTTP(timeout_read_server), + HTTP_OPT(timeout_read_server, TT_RETRIABLE), #ifdef EVENT__HAVE_OPENSSL HTTPS(basic),