From 6afc57569a1c963a02db6e3ecac73ff5fedee27a Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 22 Oct 2026 22:50:38 +0200 Subject: [PATCH] Test zero-delay sender wakeups and failure injection --- tests/Makefile.am | 2 +- tests/test_etcp_windows.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 660814a9..e90e5cb1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1013,7 +1013,7 @@ test_etcp_session_LDFLAGS = $(test_clock_ldflags) test_etcp_windows_SOURCES = test_etcp_windows.c $(test_clock_sources) test_etcp_windows_LDADD = $(LIBUTUN) $(COMMON_LIBS) test_etcp_windows_LDFLAGS = $(test_clock_ldflags) -Wl,--wrap=etcp_encrypt_send -Wl,--wrap=memory_pool_alloc_impl \ - -Wl,--wrap=bbr_main -Wl,--wrap=uasync_set_timeout + -Wl,--wrap=bbr_main -Wl,--wrap=uasync_set_timeout -Wl,--wrap=uasync_call_soon test_etcp_router_tcp_SOURCES = test_etcp_router_tcp.c test_etcp_router_tcp_LDADD = $(LIBUTUN) $(COMMON_LIBS) diff --git a/tests/test_etcp_windows.c b/tests/test_etcp_windows.c index cf8f2086..ce5abf93 100644 --- a/tests/test_etcp_windows.c +++ b/tests/test_etcp_windows.c @@ -299,6 +299,14 @@ static void timer_failure(void) { etcp_conn_ref_free(conn); teardown(); } +static void immediate_send(void) { + setup(); enqueue(100); + CHECK(conn->tx_token && !conn->tx_delayed); + uasync_drain_immediate(ua); + CHECK(sends == 1 && conn->input_wait_ack->count == 1); + ack_all(); teardown(); +} + int main(void) { debug_config_init(); debug_set_level(DEBUG_LEVEL_ERROR); if (getenv("UTUN_TEST_DEBUG")) debug_set_category_level(DEBUG_CATEGORY_ETCP, DEBUG_LEVEL_DEBUG); @@ -306,7 +314,7 @@ int main(void) { size_t baseline = u_get_allocated_count(); void (*cases[])(void) = {selection, boundaries_ack_burst, late_ack_and_migration, lost_ack_and_shrink, grow_and_session, allocation_and_send_failure, removed_link_and_bbr, pacing_reset_close, initial_readiness, - config_limits, timer_failure}; + config_limits, timer_failure, immediate_send}; for (unsigned i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) { cases[i](); CHECK(u_get_allocated_count() == baseline); DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "PASS ETCP window scenario %u", i);