diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2015-09-09 04:30:11 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2015-09-09 04:30:11 +0300 |
commit | 5b16d227742bb451ce9c7019bb7b87512c424aa7 (patch) | |
tree | f8899d47c8e6bf80850343d0b068bcee6c179c8c /mcs | |
parent | cf5f99d83aa67f2a8e05d65d0be6949aaf904e89 (diff) |
[System] Make ServicePointTest.DnsRefreshTimeout test more reliable
The previous 2ms timeout was way too short and the test failed frequently.
Also switch to Assert.AreSame/AreNotSame instead of AreEqual/AreNotEqual since
we want to ensure the same object is returned and not just an equal one.
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System/Test/System.Net/ServicePointTest.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mcs/class/System/Test/System.Net/ServicePointTest.cs b/mcs/class/System/Test/System.Net/ServicePointTest.cs index cb6a705905a..79858202cc1 100644 --- a/mcs/class/System/Test/System.Net/ServicePointTest.cs +++ b/mcs/class/System/Test/System.Net/ServicePointTest.cs @@ -210,7 +210,7 @@ public class ServicePointTest [Test] public void DnsRefreshTimeout () { - const int dnsRefreshTimeout = 2; + const int dnsRefreshTimeout = 200; ServicePoint sp; IPHostEntry host0, host1, host2; @@ -227,12 +227,12 @@ public class ServicePointTest host0 = hostEntryProperty.GetValue (sp, null) as IPHostEntry; host1 = hostEntryProperty.GetValue (sp, null) as IPHostEntry; - Assert.AreEqual (host0, host1, "HostEntry should result in the same IPHostEntry object."); + Assert.AreSame (host0, host1, "HostEntry should result in the same IPHostEntry object."); - Thread.Sleep (dnsRefreshTimeout); + Thread.Sleep (dnsRefreshTimeout * 2); host2 = hostEntryProperty.GetValue (sp, null) as IPHostEntry; - Assert.AreNotEqual(host0, host2, "HostEntry should result in a new IPHostEntry " + + Assert.AreNotSame(host0, host2, "HostEntry should result in a new IPHostEntry " + "object when DnsRefreshTimeout is reached."); } |