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

Function TEST_F

src/tests/master_contender_detector_tests.cpp:101–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100
101TEST_F(MasterContenderDetectorTest, File)
102{
103 Try<Owned<cluster::Master>> master = StartMaster();
104 ASSERT_SOME(master);
105
106 // Write "master" to a file and use the "file://" mechanism to
107 // create a master detector for the slave. Still requires a master
108 // detector for the master first.
109 slave::Flags flags = CreateSlaveFlags();
110
111 const string& path = path::join(flags.work_dir, "master");
112 ASSERT_SOME(os::write(path, stringify(master.get()->pid)));
113
114 Try<MasterDetector*> _detector = MasterDetector::create(uri::from_path(path));
115
116 ASSERT_SOME(_detector);
117
118 Owned<MasterDetector> detector(_detector.get());
119
120 Try<Owned<cluster::Slave>> slave = StartSlave(detector.get(), flags);
121 ASSERT_SOME(slave);
122
123 MockScheduler sched;
124 MesosSchedulerDriver driver(
125 &sched, DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
126
127 EXPECT_CALL(sched, registered(&driver, _, _));
128
129 Future<vector<Offer>> offers;
130 EXPECT_CALL(sched, resourceOffers(&driver, _))
131 .WillOnce(FutureArg<1>(&offers));
132
133 driver.start();
134
135 AWAIT_READY(offers);
136
137 driver.stop();
138 driver.join();
139}
140
141
142TEST(BasicMasterContenderDetectorTest, Contender)

Callers

nothing calls this directly

Calls 15

from_pathFunction · 0.85
createMasterInfoFunction · 0.85
NoneClass · 0.85
filterFunction · 0.85
MinutesClass · 0.85
SecondsClass · 0.85
protobufFunction · 0.85
connectStringMethod · 0.80
sessionMethod · 0.80
expireSessionMethod · 0.80
awaitSessionEventMethod · 0.80
shutdownNetworkMethod · 0.80

Tested by

no test coverage detected