diff --git a/test/WebSites/RazorWebSite/Services/WaitService.cs b/test/WebSites/RazorWebSite/Services/WaitService.cs index 2a87a718b6..0505187b90 100644 --- a/test/WebSites/RazorWebSite/Services/WaitService.cs +++ b/test/WebSites/RazorWebSite/Services/WaitService.cs @@ -8,7 +8,7 @@ namespace RazorWebSite { public class WaitService { - private static readonly TimeSpan _waitTime = TimeSpan.FromSeconds(10); + private static readonly TimeSpan _waitTime = TimeSpan.FromSeconds(60); private readonly ManualResetEventSlim _serverResetEvent = new ManualResetEventSlim(); private readonly ManualResetEventSlim _clientResetEvent = new ManualResetEventSlim(); @@ -20,14 +20,24 @@ namespace RazorWebSite public void WaitForClient() { _clientResetEvent.Set(); - _serverResetEvent.Wait(_waitTime); + + if (!_serverResetEvent.Wait(_waitTime)) + { + throw new InvalidOperationException("Timeout exceeded"); + } + _serverResetEvent.Reset(); } public void WaitForServer() { _serverResetEvent.Set(); - _clientResetEvent.Wait(_waitTime); + + if (!_clientResetEvent.Wait(_waitTime)) + { + throw new InvalidOperationException("Timeout exceeded"); + } + _clientResetEvent.Reset(); } }