Esempio n. 1
0
        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;
            });
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        public async Task StartWorkerProcessAsync_Invoked()
        {
            var initTask = _workerChannel.StartWorkerProcessAsync();

            _testFunctionRpcService.PublishStartStreamEvent(_workerId);
            _testFunctionRpcService.PublishWorkerInitResponseEvent();
            await initTask;

            _mockrpcWorkerProcess.Verify(m => m.StartProcessAsync(), Times.Once);
        }