File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ int result_exp_timeout;
31
31
32
32
const int EXTERNAL_THREAD_SIZE = 2048 ;
33
33
const int EVENT_QUEUE_SIZE = 10 ;
34
+ const int MAX_TRIAL_ATTEMPTS = 15 ;
34
35
35
36
events::EventQueue *event_queue;
36
37
}
@@ -64,8 +65,21 @@ void ASYNCHRONOUS_DNS_TIMEOUTS()
64
65
// Depends on timing, but at least one operation shall fail to timeout
65
66
TEST_ASSERT (result_exp_timeout > 0 );
66
67
67
- // Give event queue time to finalise before destructors
68
- ThisThread::sleep_for (12000 );
69
-
70
68
nsapi_dns_call_in_set (0 );
69
+
70
+ nsapi_dns_reset ();
71
+ SocketAddress address;
72
+ nsapi_error_t result;
73
+ int count = MAX_TRIAL_ATTEMPTS;
74
+ do {
75
+ result = NetworkInterface::get_default_instance ()->gethostbyname (dns_test_hosts[0 ], &address);
76
+ if (result == NSAPI_ERROR_OK) {
77
+ return ;
78
+ }
79
+ ThisThread::sleep_for (1000 );
80
+ count--;
81
+ } while (result != NSAPI_ERROR_OK && count);
82
+
83
+
71
84
}
85
+
You can’t perform that action at this time.
0 commit comments