mirror of
https://github.com/kevincolyar/CronNET.git
synced 2025-03-15 01:57:21 +01:00
Best unit test, but takes longer to complete
This commit is contained in:
parent
5437f8236f
commit
82851d44f7
|
@ -181,12 +181,15 @@ namespace CronTests
|
|||
}
|
||||
|
||||
[Test]
|
||||
public static void ppp()
|
||||
public static void JobMustStartWithinTwoMinutes()
|
||||
{
|
||||
var ss = new SemaphoreSlim(1);
|
||||
ss.Wait(0);
|
||||
var d = new CronDaemon();
|
||||
d.AddJob("*/1 * * * *", () => { Console.WriteLine(DateTime.Now.ToString()); });
|
||||
d.AddJob("*/1 * * * *", () => { ss.Release(); });
|
||||
d.Start();
|
||||
//Thread.Sleep(60 * 1000);
|
||||
Assert.IsTrue(ss.Wait(TimeSpan.FromMinutes(2)));
|
||||
ss.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user