You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2018/03/26 17:21:15 UTC
mesos git commit: Removed SlaveTest.ChangeDomain.
Repository: mesos
Updated Branches:
refs/heads/master 008e0682c -> 2e2e38628
Removed SlaveTest.ChangeDomain.
This test was originally written with the assumption that the
would give get a new agent id after receiving a Shutdown
message from the master.
When that behaviour was changed, the test was disabled since
the agent could not reuse the previous agent id when a fault
domain was added.
With the introduction of reconfiguration policies, this feature
is now tested by SlaveTest.ReconfigurationPolicy, making this test
obsolete.
Review: https://reviews.apache.org/r/66248/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2e2e3862
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2e2e3862
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2e2e3862
Branch: refs/heads/master
Commit: 2e2e38628c1b580a231ddac5270f9848ea4af7af
Parents: 008e068
Author: Benno Evers <be...@mesosphere.com>
Authored: Mon Mar 26 19:20:53 2018 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Mon Mar 26 19:20:53 2018 +0200
----------------------------------------------------------------------
src/tests/slave_tests.cpp | 82 ------------------------------------------
1 file changed, 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/2e2e3862/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index d695622..0d7d972 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -9367,88 +9367,6 @@ TEST_F(SlaveTest, ExecutorReregistrationTimeoutFlag)
}
-// This test checks that if an agent is shutdown gracefully, then its
-// domain is configured and the agent is restarted, the agent restarts
-// successfully. Note that shutting down the agent gracefully (killing
-// all tasks) is necessary, because changing the agent's domain is an
-// incompatible change to its SlaveInfo.
-//
-// TODO(anand): Re-enable this test when fault domain upgrade is supported,
-// see MESOS-8711.
-TEST_F(SlaveTest, DISABLED_ChangeDomain)
-{
- Clock::pause();
-
- master::Flags masterFlags = CreateMasterFlags();
- masterFlags.domain = createDomainInfo("region-abc", "zone-123");
-
- Try<Owned<cluster::Master>> master = StartMaster(masterFlags);
- ASSERT_SOME(master);
-
- slave::Flags slaveFlags = CreateSlaveFlags();
-
- Future<SlaveRegisteredMessage> slaveRegisteredMessage1 =
- FUTURE_PROTOBUF(SlaveRegisteredMessage(), _, _);
-
- StandaloneMasterDetector detector(master.get()->pid);
- Try<Owned<cluster::Slave>> slave1 = StartSlave(&detector, slaveFlags);
- ASSERT_SOME(slave1);
-
- Clock::advance(slaveFlags.registration_backoff_factor);
- AWAIT_READY(slaveRegisteredMessage1);
-
- // Gracefully shutdown the agent.
- slave1.get()->shutdown();
-
- // Restart the agent with a domain. We use the same `slave::Flags`,
- // so the new instance of the agent uses the same `work_dir`.
- const string AGENT_REGION = "region-abc";
- const string AGENT_ZONE = "zone-456";
-
- slaveFlags.domain = createDomainInfo(AGENT_REGION, AGENT_ZONE);
-
- Future<SlaveRegisteredMessage> slaveRegisteredMessage2 =
- FUTURE_PROTOBUF(SlaveRegisteredMessage(), _, _);
-
- Try<Owned<cluster::Slave>> slave2 = StartSlave(&detector, slaveFlags);
- ASSERT_SOME(slave2);
-
- Clock::advance(slaveFlags.registration_backoff_factor);
- AWAIT_READY(slaveRegisteredMessage2);
-
- // The agent should be assigned a new AgentID.
- EXPECT_NE(slaveRegisteredMessage1->slave_id(),
- slaveRegisteredMessage2->slave_id());
-
- // Check that the new agent domain is correctly reflected in the
- // master's HTTP endpoints.
- {
- Future<Response> response = process::http::get(
- master.get()->pid,
- "slaves",
- None(),
- createBasicAuthHeaders(DEFAULT_CREDENTIAL));
-
- AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
- AWAIT_EXPECT_RESPONSE_HEADER_EQ(APPLICATION_JSON, "Content-Type", response);
-
- Try<JSON::Object> parse = JSON::parse<JSON::Object>(response->body);
- ASSERT_SOME(parse);
-
- JSON::Array slaves = parse->values["slaves"].as<JSON::Array>();
- ASSERT_EQ(1u, slaves.values.size());
-
- Result<JSON::String> agentRegion = parse->find<JSON::String>(
- "slaves[0].domain.fault_domain.region.name");
- Result<JSON::String> agentZone = parse->find<JSON::String>(
- "slaves[0].domain.fault_domain.zone.name");
-
- EXPECT_SOME_EQ(JSON::String(AGENT_REGION), agentRegion);
- EXPECT_SOME_EQ(JSON::String(AGENT_ZONE), agentZone);
- }
-}
-
-
class DefaultContainerDNSFlagTest
: public MesosTest,
public WithParamInterface<string> {};