Skip to content

Commit

Permalink
adjust test tcp server (#405)
Browse files Browse the repository at this point in the history
Adjusts the tcp server code used in thread safety tests in an attempt to
prevent false failures caused by premature connection termination.
  • Loading branch information
goatshriek authored Feb 12, 2024
1 parent 2e8d0b6 commit 4d78f2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/thread_safety/target/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace {
const int THREAD_COUNT = 8;
const int MESSAGE_COUNT = 50;
const int WRITE_COUNT = MESSAGE_COUNT / 10;
const int ACCEPT_COUNT = THREAD_COUNT * WRITE_COUNT * 2 + 1;
const int ACCEPT_COUNT = THREAD_COUNT * WRITE_COUNT * 2;

void
read_network_target( const struct stumpless_target *target, bool is_udp ) {
Expand Down Expand Up @@ -163,6 +163,7 @@ namespace {
false );

// cleanup after the test
listener_thread->join();
stumpless_close_network_target( target );
EXPECT_NO_ERROR;
stumpless_free_all( );
Expand Down Expand Up @@ -198,6 +199,7 @@ namespace {
false );

// cleanup after the test
listener_thread->join();
stumpless_close_network_target( target );
EXPECT_NO_ERROR;
stumpless_free_all( );
Expand Down

0 comments on commit 4d78f2c

Please sign in to comment.