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

Function TEST_P_TEMP_DISABLED_ON_WINDOWS

src/tests/default_executor_tests.cpp:2434–2549  ·  view source on GitHub ↗

This test verifies that a resource limitation incurred on a nested container is propagated all the way up to the scheduler.

Source from the content-addressed store, hash-verified

2432// This test verifies that a resource limitation incurred on a nested
2433// container is propagated all the way up to the scheduler.
2434TEST_P_TEMP_DISABLED_ON_WINDOWS(DefaultExecutorTest, ResourceLimitation)
2435{
2436 Try<Owned<cluster::Master>> master = StartMaster();
2437 ASSERT_SOME(master);
2438
2439 slave::Flags flags = CreateSlaveFlags();
2440 flags.containerizers = GetParam();
2441 flags.enforce_container_disk_quota = true;
2442 flags.container_disk_watch_interval = Milliseconds(1);
2443 flags.isolation = "disk/du";
2444
2445 Owned<MasterDetector> detector = master.get()->createDetector();
2446 Try<Owned<cluster::Slave>> slave = StartSlave(detector.get(), flags);
2447 ASSERT_SOME(slave);
2448
2449 auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
2450
2451 EXPECT_CALL(*scheduler, connected(_))
2452 .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
2453
2454 Future<v1::scheduler::Event::Subscribed> subscribed;
2455 EXPECT_CALL(*scheduler, subscribed(_, _))
2456 .WillOnce(FutureArg<1>(&subscribed));
2457
2458 Future<v1::scheduler::Event::Offers> offers;
2459 EXPECT_CALL(*scheduler, offers(_, _))
2460 .WillOnce(FutureArg<1>(&offers))
2461 .WillRepeatedly(Return());
2462
2463 EXPECT_CALL(*scheduler, heartbeat(_))
2464 .WillRepeatedly(Return()); // Ignore heartbeats.
2465
2466 v1::scheduler::TestMesos mesos(
2467 master.get()->pid,
2468 ContentType::PROTOBUF,
2469 scheduler);
2470
2471 AWAIT_READY(subscribed);
2472 v1::FrameworkID frameworkId(subscribed->framework_id());
2473
2474 v1::Resources resources =
2475 v1::Resources::parse("cpus:0.1;mem:32;disk:10").get();
2476
2477 v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
2478 v1::DEFAULT_EXECUTOR_ID,
2479 None(),
2480 resources,
2481 v1::ExecutorInfo::DEFAULT,
2482 frameworkId);
2483
2484 AWAIT_READY(offers);
2485 ASSERT_FALSE(offers->offers().empty());
2486
2487 const v1::Offer& offer = offers->offers(0);
2488 const v1::AgentID& agentId = offer.agent_id();
2489
2490 Future<v1::scheduler::Event::Update> starting;
2491 Future<v1::scheduler::Event::Update> running;

Callers

nothing calls this directly

Calls 15

MillisecondsClass · 0.85
createExecutorInfoFunction · 0.85
NoneClass · 0.85
createCallAcceptFunction · 0.85
LAUNCH_GROUPFunction · 0.85
createTaskGroupInfoFunction · 0.85
MinutesClass · 0.85
from_pathFunction · 0.85
createPersistentVolumeFunction · 0.85
MegabytesFunction · 0.85
RESERVEFunction · 0.85

Tested by

no test coverage detected