| 140 | |
| 141 | |
| 142 | TEST(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 | |
| 167 | TEST(BasicMasterContenderDetectorTest, Detector) |
nothing calls this directly
no test coverage detected