MCPcopy Create free account
hub / github.com/apache/mesos / TEST

Function TEST

src/tests/master_contender_detector_tests.cpp:142–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141
142TEST(BasicMasterContenderDetectorTest, Contender)
143{
144 PID<Master> master;
145 master.address.ip = net::IP(10000000);
146 master.address.port = 10000;
147
148 Owned<MasterContender> contender(new StandaloneMasterContender());
149
150 contender->initialize(createMasterInfo(master));
151
152 Future<Future<Nothing>> contended = contender->contend();
153 AWAIT_READY(contended);
154
155 Future<Nothing> lostCandidacy = contended.get();
156
157 // The candidacy is never lost.
158 EXPECT_TRUE(lostCandidacy.isPending());
159
160 contender.reset();
161
162 // Deleting the contender also withdraws the previous candidacy.
163 AWAIT_READY(lostCandidacy);
164}
165
166
167TEST(BasicMasterContenderDetectorTest, Detector)

Callers

nothing calls this directly

Calls 12

createMasterInfoFunction · 0.85
IPFunction · 0.50
parseFunction · 0.50
initializeMethod · 0.45
contendMethod · 0.45
getMethod · 0.45
isPendingMethod · 0.45
resetMethod · 0.45
detectMethod · 0.45
discardMethod · 0.45
appointMethod · 0.45
addressMethod · 0.45

Tested by

no test coverage detected