tests: net: socket: tcp: Make test_vX_msg_waitall more robust
The close function on a TCP socket can return before the complete socket has been closed, as there might be packets still in flight. Add a wait at the end of the test so we are sure all sockets have been closed before the next test starts. Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
This commit is contained in:
parent
cf3466ff74
commit
11288cdbdd
|
@ -1167,6 +1167,8 @@ void test_v4_msg_waitall(void)
|
|||
test_close(new_sock);
|
||||
test_close(s_sock);
|
||||
test_close(c_sock);
|
||||
|
||||
k_sleep(TCP_TEARDOWN_TIMEOUT);
|
||||
}
|
||||
|
||||
void test_v6_msg_waitall(void)
|
||||
|
@ -1241,6 +1243,8 @@ void test_v6_msg_waitall(void)
|
|||
test_close(new_sock);
|
||||
test_close(s_sock);
|
||||
test_close(c_sock);
|
||||
|
||||
k_sleep(TCP_TEARDOWN_TIMEOUT);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
|
|
Loading…
Reference in a new issue