mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-03 03:41:53 +08:00
Add randomlyRenameZoneId test parameter
This commit is contained in:
parent
7acb633db8
commit
59794ffcb2
@ -269,6 +269,9 @@ class TestConfig {
|
|||||||
configDBType = configDBTypeFromString(value);
|
configDBType = configDBTypeFromString(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (attrib == "randomlyRenameZoneId") {
|
||||||
|
randomlyRenameZoneId = strcmp(value.c_str(), "true") == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ifs.close();
|
ifs.close();
|
||||||
@ -306,6 +309,7 @@ public:
|
|||||||
Optional<int> datacenters, desiredTLogCount, commitProxyCount, grvProxyCount, resolverCount, storageEngineType,
|
Optional<int> datacenters, desiredTLogCount, commitProxyCount, grvProxyCount, resolverCount, storageEngineType,
|
||||||
stderrSeverity, machineCount, processesPerMachine, coordinators;
|
stderrSeverity, machineCount, processesPerMachine, coordinators;
|
||||||
Optional<std::string> config;
|
Optional<std::string> config;
|
||||||
|
bool randomlyRenameZoneId = false;
|
||||||
|
|
||||||
ConfigDBType getConfigDBType() const { return configDBType; }
|
ConfigDBType getConfigDBType() const { return configDBType; }
|
||||||
|
|
||||||
@ -357,7 +361,8 @@ public:
|
|||||||
.add("processesPerMachine", &processesPerMachine)
|
.add("processesPerMachine", &processesPerMachine)
|
||||||
.add("coordinators", &coordinators)
|
.add("coordinators", &coordinators)
|
||||||
.add("configDB", &configDBType)
|
.add("configDB", &configDBType)
|
||||||
.add("extraMachineCountDC", &extraMachineCountDC);
|
.add("extraMachineCountDC", &extraMachineCountDC)
|
||||||
|
.add("randomlyRenameZoneId", &randomlyRenameZoneId);
|
||||||
try {
|
try {
|
||||||
auto file = toml::parse(testFile);
|
auto file = toml::parse(testFile);
|
||||||
if (file.contains("configuration") && toml::find(file, "configuration").is_table()) {
|
if (file.contains("configuration") && toml::find(file, "configuration").is_table()) {
|
||||||
@ -1032,6 +1037,11 @@ ACTOR Future<Void> restartSimulatedSystem(std::vector<Future<Void>>* systemActor
|
|||||||
|
|
||||||
auto configDBType = testConfig.getConfigDBType();
|
auto configDBType = testConfig.getConfigDBType();
|
||||||
|
|
||||||
|
// Randomly change data center id names to test that localities
|
||||||
|
// can be modified on cluster restart
|
||||||
|
bool renameZoneIds = testConfig.randomlyRenameZoneId ? deterministicRandom()->random01() < 0.1 : false;
|
||||||
|
TEST(renameZoneIds); // Zone ID names altered in restart test
|
||||||
|
|
||||||
// allows multiple ipAddr entries
|
// allows multiple ipAddr entries
|
||||||
ini.SetMultiKey();
|
ini.SetMultiKey();
|
||||||
|
|
||||||
@ -1080,7 +1090,11 @@ ACTOR Future<Void> restartSimulatedSystem(std::vector<Future<Void>>* systemActor
|
|||||||
if (zoneIDini == nullptr) {
|
if (zoneIDini == nullptr) {
|
||||||
zoneId = machineId;
|
zoneId = machineId;
|
||||||
} else {
|
} else {
|
||||||
zoneId = StringRef(zoneIDini);
|
auto zoneIdStr = std::string(zoneIDini);
|
||||||
|
if (renameZoneIds) {
|
||||||
|
zoneIdStr = "modified/" + zoneIdStr;
|
||||||
|
}
|
||||||
|
zoneId = Standalone<StringRef>(zoneIdStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessClass::ClassType cType =
|
ProcessClass::ClassType cType =
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
[[configuration]]
|
||||||
|
randomlyRenameZoneId=true
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
testTitle='CloggedConfigureDatabaseTest'
|
testTitle='CloggedConfigureDatabaseTest'
|
||||||
runSetup=false
|
runSetup=false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user