public void should_be_able_to_read_event_on_slaves()
        {
            var slaves          = GetSlaves();
            var quorum          = (slaves.Count() + 1) / 2 + 1;
            var successfulReads = 0;

            foreach (var s in slaves)
            {
                var readResult = ReplicationTestHelper.ReadEvent(s, _streamId, 0);
                successfulReads += readResult.Result == ReadEventResult.Success ? 1 : 0;
            }

            Assert.GreaterOrEqual(successfulReads, quorum - 1);
        }
        public void should_be_able_to_read_event_on_followers()
        {
            var followers       = GetFollowers();
            var quorum          = (followers.Count() + 1) / 2 + 1;
            var successfulReads = 0;

            foreach (var s in followers)
            {
                AssertEx.IsOrBecomesTrue(() => s.Db.Config.IndexCheckpoint.Read() == _indexPosition);
                var readResult = ReplicationTestHelper.ReadEvent(s, _streamId, 0);
                successfulReads += readResult.Result == ReadEventResult.Success ? 1 : 0;
            }

            Assert.GreaterOrEqual(successfulReads, quorum - 1);
        }
Esempio n. 3
0
        public void should_be_able_to_read_event_on_master()
        {
            var readResult = ReplicationTestHelper.ReadEvent(GetMaster(), _streamId, 0);

            Assert.AreEqual(ReadEventResult.Success, readResult.Result);
        }
        public void should_not_be_able_to_read_event()
        {
            var readResult = ReplicationTestHelper.ReadEvent(_liveNode, _streamId, 0);

            Assert.AreEqual(ReadEventResult.Success, readResult.Result);
        }