Skip to content

Commit 2b9e1f3

Browse files
author
Teppo Järvelin
committed
Fix networkinterface non-blocking status test
Fix was to add some time between iterations connect-disconnect. In cellular disconnect, cellular network may send disconnect events and if those events come when connect is already ongoing test will fail. So wait a bit after disconnect so that disconnect events should be over.
1 parent 2b354a4 commit 2b9e1f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

TESTS/network/interface/networkinterface_status.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ void NETWORKINTERFACE_STATUS_NONBLOCK()
131131

132132
status = wait_status_callback();
133133
TEST_ASSERT_EQUAL(NSAPI_STATUS_DISCONNECTED, status);
134+
135+
wait(1); // In cellular there might still come disconnected messages from the network which are sent to callback.
136+
// This would cause this test to fail as next connect is already ongoing. So wait here a while until (hopefully)
137+
// all messages also from the network have arrived.
134138
}
135139

136140
net->attach(NULL);

0 commit comments

Comments
 (0)