[System.Runtime.Caching] Bump timeout in tests to make them more reliable
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 27 Jan 2016 11:29:45 +0000 (12:29 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 27 Jan 2016 11:29:45 +0000 (12:29 +0100)
Failed on Jenkins on ARM today:

```
Tests run: 38, Failures: 1, Not run: 0, Time: 32.132 seconds

Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration :   #A4-4
  Expected: not null
  But was:  null

at MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration () [0x002b6] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:902
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

100ms could be too short, bumping the timeout should make it more reliable on the slower ARM machines.

mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs

index c82729741e3c2cd60fb064aafc8dead609f8d13d..dada449fb86aa51a06c65aac930d4208bb04ea0d 100644 (file)
@@ -844,7 +844,7 @@ namespace MonoTests.System.Runtime.Caching
                        };
                        cip.AbsoluteExpiration = DateTimeOffset.Now.AddMilliseconds (50);
                        mc.Set ("key", "value", cip);
-                       Thread.Sleep (100);
+                       Thread.Sleep (500);
 
                        Assert.IsFalse (expired, "#A1");
                        object value = mc.Get ("key");
@@ -892,7 +892,7 @@ namespace MonoTests.System.Runtime.Caching
 
                        cip = new CacheItemPolicy ();
                        cip.RemovedCallback = removedCb;
-                       cip.AbsoluteExpiration = DateTimeOffset.Now.AddMilliseconds (sleepPeriod + 100);
+                       cip.AbsoluteExpiration = DateTimeOffset.Now.AddMilliseconds (sleepPeriod + 500);
                        mc.Set ("key4", "value4", cip);
                        
                        Thread.Sleep (sleepPeriod);
@@ -930,7 +930,7 @@ namespace MonoTests.System.Runtime.Caching
                        };
 
                        mc.Set ("key4", "value4", cip);
-                       Thread.Sleep (100);
+                       Thread.Sleep (500);
 
                        enumerator = ((IEnumerable) mc).GetEnumerator ();
                        int count = 0;
@@ -949,7 +949,7 @@ namespace MonoTests.System.Runtime.Caching
                        };
 
                        mc.Set ("key5", "value5", cip);
-                       Thread.Sleep (100);
+                       Thread.Sleep (500);
 
                        enumerator2 = mc.DoGetEnumerator ();
                        count = 0;