Skip to content

Commit a31e353

Browse files
rluboskartben
authored andcommitted
tests: net: tls_ext: Fix scheduling race
After recent kernel changes there's some thread scheduling race when running tests, therefore add k_yield() at the end of the test to make sure the network stack has a chance to run in between tests. Make sure CONFIG_NET_TCP_TIME_WAIT_DELAY is set to 0 so that TCP connections are released immediately. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1 parent 32dd873 commit a31e353

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

tests/net/socket/tls_ext/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CONFIG_NET_LOOPBACK=y
1212
CONFIG_NET_IPV4=y
1313
CONFIG_NET_TCP=y
1414
CONFIG_NET_SOCKETS=y
15+
CONFIG_NET_TCP_TIME_WAIT_DELAY=0
1516

1617
# Logging / Debugging options
1718
CONFIG_NET_LOG=y

tests/net/socket/tls_ext/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ static void test_common(int peer_verify)
399399

400400
r = k_thread_join(&server_thread, K_FOREVER);
401401
zassert_equal(0, r, "k_thread_join() failed (%d)", r);
402+
403+
k_yield();
402404
}
403405

404406
ZTEST(net_socket_tls_api_extension, test_tls_peer_verify_none)

0 commit comments

Comments
 (0)