public new void SetUp() { _restartOnFailureHandler = new RestartOnFailureStrategy(); _settings = new FailureSettings { HeartbeatSettings = { ReportSkippedHeartbeatsAsFailureWithDebuggerAttached = true, Interval = TimeSpan.FromMilliseconds(100) } }; _silo = new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: _settings, failureHandler: _restartOnFailureHandler); _startHandle = new ManualResetEvent(false); }
public void TestStart4() { const int taskCount = 16; var failureHandler = new RestartOnFailureStrategy(); var tasks = new Task[taskCount]; for (int i = 0; i < taskCount; ++i) { tasks[i] = new Task(() => { using (var silo = new OutOfProcessSilo(failureHandler: failureHandler)) { silo.IsProcessRunning.Should().BeFalse(); silo.Start(); silo.IsProcessRunning.Should().BeTrue(); var proxy = silo.CreateGrain <IGetStringProperty>(typeof(GetStringPropertyImplementation)); proxy.Value.Should().Be("Foobar"); } }); tasks[i].Start(); } Task.WaitAll(tasks); }