diff --git a/XenAdminTests/MiscTests/UpdateManagerTests.cs b/XenAdminTests/MiscTests/UpdateManagerTests.cs index 8d29c7ad2..29cb1a95e 100644 --- a/XenAdminTests/MiscTests/UpdateManagerTests.cs +++ b/XenAdminTests/MiscTests/UpdateManagerTests.cs @@ -146,64 +146,5 @@ namespace XenAdminTests.MiscTests secondUpdateStarted = true; _um.RequestUpdate(); } - - private void TestUpdateDelays(int n, int requestPeriod, int updateDuration) - { - Stopwatch sw = Stopwatch.StartNew(); - List times = new List(); - int max = Math.Max(requestPeriod, updateDuration); - - _um.Update += delegate - { - times.Add(sw.ElapsedMilliseconds); - AccurateSleep(updateDuration); - }; - - for (int i = 0; i < n; i++) - { - _um.RequestUpdate(); - AccurateSleep(requestPeriod); - } - - // wait for everything to finish - AccurateSleep(Leeway + (n * max)); - - for (int i = 1; i < times.Count; i++) - { - if (requestPeriod > updateDuration) - { - Assert.Less(times[i], times[i - 1] + max + Leeway, string.Format("The delay was too long between updates {0} and {1}.", i, i - 1)); - } - else - { - Assert.GreaterOrEqual(times[i], times[i - 1] + Delay + max - Leeway, string.Format("There was no delay between updates {0} and {1}.", i, i-1)); - Assert.Less(times[i], times[i - 1] + Delay + max + Leeway, string.Format("The delay was too long between updates {0} and {1}.", i, i - 1)); - } - } - } - - [Test] - public void TestDelay1() - { - TestUpdateDelays(5, 800, 500); - } - - [Test] - public void TestDelay2() - { - TestUpdateDelays(5, 500, 800); - } - - [Test] - public void TestDelay3() - { - TestUpdateDelays(5, 10, 1000); - } - - [Test, Ignore] //TODO: investigate failure, performance seems to be lower - public void TestDelay4() - { - TestUpdateDelays(5, 1000, 10); - } } }