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

Function TEST_F_TEMP_DISABLED_ON_WINDOWS

src/tests/command_executor_tests.cpp:585–670  ·  view source on GitHub ↗

This test ensures that the HTTP command executor can self terminate after it gets the ACK for the terminal status update from agent.

Source from the content-addressed store, hash-verified

583// This test ensures that the HTTP command executor can self terminate
584// after it gets the ACK for the terminal status update from agent.
585TEST_F_TEMP_DISABLED_ON_WINDOWS(HTTPCommandExecutorTest, TerminateWithACK)
586{
587 Try<Owned<cluster::Master>> master = StartMaster();
588 ASSERT_SOME(master);
589
590 slave::Flags flags = CreateSlaveFlags();
591 flags.http_command_executor = true;
592
593 Fetcher fetcher(flags);
594
595 Try<MesosContainerizer*> _containerizer =
596 MesosContainerizer::create(flags, false, &fetcher);
597
598 ASSERT_SOME(_containerizer);
599 Owned<MesosContainerizer> containerizer(_containerizer.get());
600
601 StandaloneMasterDetector detector(master.get()->pid);
602
603 Try<Owned<cluster::Slave>> slave = StartSlave(
604 &detector,
605 containerizer.get(),
606 flags,
607 true);
608
609 ASSERT_SOME(slave);
610 ASSERT_NE(nullptr, slave.get()->mock());
611
612 slave.get()->start();
613
614 MockScheduler sched;
615 MesosSchedulerDriver driver(
616 &sched, DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
617
618 EXPECT_CALL(sched, registered(&driver, _, _));
619
620 Future<vector<Offer>> offers;
621 EXPECT_CALL(sched, resourceOffers(&driver, _))
622 .WillOnce(FutureArg<1>(&offers))
623 .WillRepeatedly(Return()); // Ignore subsequent offers.
624
625 driver.start();
626
627 AWAIT_READY(offers);
628 EXPECT_EQ(1u, offers->size());
629
630 // Launch a short lived task.
631 TaskInfo task = createTask(
632 offers->front().slave_id(),
633 offers->front().resources(),
634 "sleep 1");
635
636 Future<TaskStatus> statusStarting;
637 Future<TaskStatus> statusRunning;
638 Future<TaskStatus> statusFinished;
639
640 EXPECT_CALL(sched, statusUpdate(_, _))
641 .WillOnce(FutureArg<1>(&statusStarting))
642 .WillOnce(FutureArg<1>(&statusRunning))

Callers

nothing calls this directly

Calls 14

mockMethod · 0.80
isReadyMethod · 0.80
createTaskFunction · 0.70
startMethod · 0.65
launchTasksMethod · 0.65
stopMethod · 0.65
joinMethod · 0.65
createFunction · 0.50
getMethod · 0.45
sizeMethod · 0.45
resourcesMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected