Skip to content

Add code to verify if external Wifi module is still responsible #11819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions TESTS/netsocket/dns/asynchronous_dns_timeouts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ int result_exp_timeout;

const int EXTERNAL_THREAD_SIZE = 2048;
const int EVENT_QUEUE_SIZE = 10;
const int MAX_TRIAL_ATTEMPTS = 15;

events::EventQueue *event_queue;
}
Expand Down Expand Up @@ -66,9 +67,22 @@ void ASYNCHRONOUS_DNS_TIMEOUTS()
// Depends on timing, but at least one operation shall fail to timeout
TEST_ASSERT(result_exp_timeout > 0);

// Give event queue time to finalise before destructors
ThisThread::sleep_for(12000);

nsapi_dns_call_in_set(0);

nsapi_dns_reset();
SocketAddress address;
nsapi_error_t result;
int count = MAX_TRIAL_ATTEMPTS;
do {
result = NetworkInterface::get_default_instance()->gethostbyname(dns_test_hosts[0], &address);
if (result == NSAPI_ERROR_OK) {
return;
}
ThisThread::sleep_for(1000);
count--;
} while (result != NSAPI_ERROR_OK && count);


}
#endif // defined(MBED_CONF_RTOS_PRESENT)