[System] Rewrite Dns tests so that failures don't cause the process to crash.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 14 Sep 2016 15:33:12 +0000 (17:33 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 14 Sep 2016 15:37:42 +0000 (17:37 +0200)
commitc213a51b7055d2e43e963664fe00fe6621430732
treeedfa9fd4dfc0722538393600f1c8d9f482391cba
parent8f7a1683c23d483b40aa965801f5a7998b9bfd3a
[System] Rewrite Dns tests so that failures don't cause the process to crash.

Previously the tests were written so that some failures might occur on the
threadpool in methods that did not catch exceptions. In that case the process
would terminate due to an unhandled exception. So rewrite the tests to catch
exceptions in any code that doesn't run on the main thread, and forward those
exceptions to the main thread.

Also wait for async operations to complete on the main thread, and remove
asserts that are not supposed to be hit.
mcs/class/System/Test/System.Net/DnsTest.cs