public async Task ContinueRunningInstances() { var(_, entity) = await PutTestInstance(); var store = new StateMachineInstanceStore( _configuration, new DockerNodeStore(_configuration, new NotificationService()), new DynamicCompileService()); store.Initialize( () => new EmptyDisposable(), _ => new DummyRepository <BlobEntity, Guid>(_storage), _ => new DummyRepository <ActorEntity, Guid>(_storage), _ => new DummyRepository <StateMachineEntity, Guid>(_storage), _ => new DummyRepository <StateMachineInstanceEntity, Guid>(_storage)); var repository = new DummyRepository <StateMachineInstanceEntity, Guid>(_storage); while (true) { var stateMachine = await repository.QueryNoTrackingAsync(q => q.FirstOrDefaultAsyncTestable(x => x.Id == entity.Id)); if (stateMachine.Status == StateMachineStatus.Failed) { throw new InvalidOperationException(stateMachine.Exception); } if (stateMachine.Status == StateMachineStatus.Succeeded) { Assert.Equal(1, stateMachine.ReRunTimes); break; } await Task.Delay(1); } }
public TestStateMachineInstanceStore() { _store = new StateMachineInstanceStore( _configuration, new DockerNodeStore(_configuration, new NotificationService()), new DynamicCompileService()); _store.Initialize( () => new EmptyDisposable(), _ => new DummyRepository <BlobEntity, Guid>(_storage), _ => new DummyRepository <ActorEntity, Guid>(_storage), _ => new DummyRepository <StateMachineEntity, Guid>(_storage), _ => new DummyRepository <StateMachineInstanceEntity, Guid>(_storage)); }