tests/netinet: fix so_reuseport_lb_test flakyness

Stop the threads before exiting test body.  Otherwise there is a chance
threads would use the softc that is stored on the main thread stack after
it is destroyed and the test would fail.  Stop the threads in the reverse
order, so that listener is stopped after all connectors are stopped.

Tested by:	olivier
This commit is contained in:
Gleb Smirnoff
2025-10-07 14:02:29 -07:00
parent d801cc2d85
commit d9c94e5eef
+5
View File
@@ -375,6 +375,11 @@ ATF_TC_BODY(concurrent_add, tc)
usleep(20000);
}
for (size_t j = nitems(threads); j > 0; j--) {
ATF_REQUIRE(pthread_cancel(threads[j - 1]) == 0);
ATF_REQUIRE(pthread_join(threads[j - 1], NULL) == 0);
}
}
/*