TEST(BasicMasterContenderDetectorTest, Detector) { PID<Master> master; master.node.ip = 10000000; master.node.port = 10000; StandaloneMasterDetector detector; Future<Option<MasterInfo> > detected = detector.detect(); // No one has appointed the leader so we are pending. EXPECT_TRUE(detected.isPending()); // Ensure that the future can be discarded. detected.discard(); AWAIT_DISCARDED(detected); detected = detector.detect(); // Still no leader appointed yet. EXPECT_TRUE(detected.isPending()); detector.appoint(master); AWAIT_READY(detected); }
TEST(BasicMasterContenderDetectorTest, Detector) { PID<Master> master; master.ip = 10000000; master.port = 10000; StandaloneMasterDetector detector; Future<Result<UPID> > detected = detector.detect(); // No one has appointed the leader so we are pending. EXPECT_TRUE(detected.isPending()); detector.appoint(master); AWAIT_READY(detected); }