Skip to content

Commit 066dcd6

Browse files
Tomasz Bursztykacfriedt
authored andcommitted
tests/net: Switch k_msleep to k_yield for tcp packet scheduling
TCP work queue is of higher priority so k_yield should do the trick, and the test will not be affected by any timing. Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent ffcc1d3 commit 066dcd6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/net/tcp2/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ static void test_server_recv_out_of_order_data(void)
13941394
zassert_true(ret == 0, "recv data failed (%d)", ret);
13951395

13961396
/* Let the IP stack to process the packet properly */
1397-
k_msleep(1);
1397+
k_yield();
13981398

13991399
/* Then we send a packet that is after the previous packet */
14001400
seq += 10;
@@ -1406,7 +1406,7 @@ static void test_server_recv_out_of_order_data(void)
14061406
ret = net_recv_data(iface, pkt);
14071407
zassert_true(ret == 0, "recv data failed (%d)", ret);
14081408

1409-
k_msleep(1);
1409+
k_yield();
14101410

14111411
/* Then send packets that are before the first packet. The final packet
14121412
* will flush the receive queue as the seq will be 1
@@ -1422,7 +1422,7 @@ static void test_server_recv_out_of_order_data(void)
14221422
ret = net_recv_data(iface, pkt);
14231423
zassert_true(ret == 0, "recv data failed (%d)", ret);
14241424

1425-
k_msleep(1);
1425+
k_yield();
14261426
}
14271427

14281428
/* Then the final packet that will flush the receive queue */

0 commit comments

Comments
 (0)