Test zero-delay sender wakeups and failure injection

This commit is contained in:
evgeny committed 2026-10-22 22:50:38 +02:00
1 parent ccb3821e2f
commit 6afc57569a
2 files changed
+10 -2

No files matched your search

+1 -1
View File
@@ -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)
+9 -1
View File
@@ -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);