Ejemplo n.º 1
0
        //[Fact(Timeout = 10000)]
        public async Task Dead_Node_Should_Not_Block_Dispose()
        {
            using var c = new MockCluster(EP("localhost:64000", "localhost:64002", "localhost:64004", "localhost:64006"),
                                          new DefaultNodeLocator(),
                                          new ImmediateReconnectPolicyFactory(),
                                          new FailNodeFactory());
            {
                c.Start();
                try { await Task.WhenAll(c.Broadcast(_ => new WorkingOperation())); } catch { }

                await Task.Delay(1000);
            }
        }
Ejemplo n.º 2
0
        //[Fact(Timeout = 1000)]
        public async Task Exception_Should_Properly_Bubble_Up()
        {
            using var c = new MockCluster(EP("localhost:64000"),
                                          new DefaultNodeLocator(),
                                          new PeriodicReconnectPolicyFactory(),
                                          new WorkingNodeFactory());

            c.Start();

            var e = await Assert.ThrowsAsync <IOException>(() => c.Execute(new FailingOperation()));

            var nie = Assert.IsType <NotImplementedException>(e.InnerException);

            Assert.Equal(FailingOperation.ExceptionMessage, nie.Message);
        }