public async Task StartWorkerProcessAsync_ThrowsTaskCanceledException_IfDisposed() { var initTask = _workerChannel.StartWorkerProcessAsync(CancellationToken.None); _workerChannel.Dispose(); _testFunctionRpcService.PublishStartStreamEvent(_workerId); _testFunctionRpcService.PublishWorkerInitResponseEvent(); await Assert.ThrowsAsync <TaskCanceledException>(async() => { await initTask; }); }
public async Task StartWorkerProcessAsync_Invoked_SetupFunctionBuffers_Verify_ReadyForInvocation() { var initTask = _workerChannel.StartWorkerProcessAsync(); _testFunctionRpcService.PublishStartStreamEvent(_workerId); _testFunctionRpcService.PublishWorkerInitResponseEvent(); await initTask; _mockrpcWorkerProcess.Verify(m => m.StartProcessAsync(), Times.Once); Assert.False(_workerChannel.IsChannelReadyForInvocations()); _workerChannel.SetupFunctionInvocationBuffers(GetTestFunctionsList("node")); Assert.True(_workerChannel.IsChannelReadyForInvocations()); }
public async Task StartWorkerProcessAsync_Invoked() { var initTask = _workerChannel.StartWorkerProcessAsync(); _testFunctionRpcService.PublishStartStreamEvent(_workerId); _testFunctionRpcService.PublishWorkerInitResponseEvent(); await initTask; _mockrpcWorkerProcess.Verify(m => m.StartProcessAsync(), Times.Once); }