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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user