public static void Stop() { try { var waitAll = RunnerController.StopAndWait(PausePeriod.Add(PausePeriod)); MainLogger.Info(waitAll ? "Jobs were stopped" : "One or more jobs were terminated with timeout"); } catch (Exception e) { MainLogger.Error("One or more jobs failed", e); throw; } Bootstrapper.ShutDown(); }
public void Test_ExceptionOnStart() { var helper = new RunnerController(); var runner = new Mock<IRunner>(MockBehavior.Strict); runner.Setup(x => x.Run(It.IsAny<CancellationTokenSource>())).Throws(new Exception("Test_ExceptionOnStart")); helper.Run(new[] { runner.Object }); try { helper.StopAndWait(TimeSpan.FromMinutes(1)); } catch (AggregateException e) { e.InnerExceptions.Count.ShouldBeEquivalentTo(1); e.InnerException.Message.ShouldBeEquivalentTo("Test_ExceptionOnStart"); throw; } }