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 @@ -33,6 +33,7 @@ int result_exp_timeout;
33
33
34
34
const int EXTERNAL_THREAD_SIZE = 2048 ;
35
35
const int EVENT_QUEUE_SIZE = 10 ;
36
+ const int MAX_TRIAL_ATTEMPTS = 15 ;
36
37
37
38
events::EventQueue *event_queue;
38
39
}
@@ -66,9 +67,22 @@ void ASYNCHRONOUS_DNS_TIMEOUTS()
66
67
// Depends on timing, but at least one operation shall fail to timeout
67
68
TEST_ASSERT (result_exp_timeout > 0 );
68
69
69
- // Give event queue time to finalise before destructors
70
- ThisThread::sleep_for (12000 );
71
-
72
70
nsapi_dns_call_in_set (0 );
71
+
72
+ nsapi_dns_reset ();
73
+ SocketAddress address;
74
+ nsapi_error_t result;
75
+ int count = MAX_TRIAL_ATTEMPTS;
76
+ do {
77
+ result = NetworkInterface::get_default_instance ()->gethostbyname (dns_test_hosts[0 ], &address);
78
+ if (result == NSAPI_ERROR_OK) {
79
+ return ;
80
+ }
81
+ ThisThread::sleep_for (1000 );
82
+ count--;
83
+ } while (result != NSAPI_ERROR_OK && count);
84
+
85
+
73
86
}
74
87
#endif // defined(MBED_CONF_RTOS_PRESENT)
88
+
You can’t perform that action at this time.
0 commit comments