Addressed review comments

This commit is contained in:
sfc-gh-tclinkenbeard 2021-06-16 11:34:20 -07:00
parent dced72ea1f
commit 9d62887f35
9 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/*
* KnobsImpl.h
* Knobs.h
*
* This source file is part of the FoundationDB open source project
*

View File

@ -1,5 +1,5 @@
/*
* Knobs.cpp
* KnobsImpl.cpp
*
* This source file is part of the FoundationDB open source project
*
@ -109,8 +109,8 @@ void ClientKnobs::initialize(Randomize _randomize) {
// Core
init( CORE_VERSIONSPERSECOND, 1e6 );
init( LOG_RANGE_BLOCK_SIZE, 1e6 ); //Dependent on CORE_VERSIONSPERSECOND
init( MUTATION_BLOCK_SIZE, 10000 );
init( LOG_RANGE_BLOCK_SIZE, CORE_VERSIONSPERSECOND );
init( MUTATION_BLOCK_SIZE, 10000);
// TaskBucket
init( TASKBUCKET_LOGGING_DELAY, 5.0 );

View File

@ -81,6 +81,8 @@ public:
auto req = get(tokenToRequest, token);
if (req.lastSeenVersion < change.version) {
tokenSet.insert(token);
} else {
TEST(true); // Worker is ahead of config broadcaster
}
}
}

View File

@ -133,7 +133,7 @@ class ReadFromLocalConfigEnvironment {
Optional<int64_t> expected) {
state double lastMismatchTime = now();
loop {
if (localConfiguration->getTestKnobs().TEST_LONG == (expected.present() ? expected.get() : 0)) {
if (localConfiguration->getTestKnobs().TEST_LONG == expected.orDefault(0)) {
return Void();
}
if (now() > lastMismatchTime + 1.0) {

View File

@ -102,6 +102,7 @@ public:
this->overrides[stringToKeyRef(knobName)] = knobValue;
} catch (Error& e) {
if (e.code() == error_code_invalid_option) {
TEST(true); // Attempted to manually set invalid knob option
fprintf(stderr, "WARNING: Unrecognized knob option '%s'\n", knobName.c_str());
TraceEvent(SevWarnAlways, "UnrecognizedKnobOption").detail("Knob", printable(knobName));
} else {
@ -181,7 +182,7 @@ class LocalConfigurationImpl {
state ConfigKnobOverrides storedConfigPath =
BinaryReader::fromStringRef<ConfigKnobOverrides>(storedConfigPathValue.get(), IncludeVersion());
if (!storedConfigPath.hasSameConfigPath(self->configKnobOverrides)) {
// All local information is outdated
TEST(true); // All local information is outdated
wait(clearKVStore(self));
wait(saveConfigPath(self));
self->updateInMemoryState(lastSeenVersion);
@ -394,3 +395,11 @@ Future<Void> LocalConfiguration::addChanges(Standalone<VectorRef<VersionedConfig
UID LocalConfiguration::getID() const {
return impl().getID();
}
TEST_CASE("/fdbserver/ConfigDB/InvalidManualKnobOverride") {
std::map<std::string, std::string> invalidOverrides;
invalidOverrides["knob_name_that_does_not_exist"] = "";
// Should only trace and not throw an error:
ManualKnobOverrides manualKnobOverrides(invalidOverrides);
return Void();
}

View File

@ -76,6 +76,7 @@ class SimpleConfigConsumerImpl {
} catch (Error& e) {
++self->failedChangeRequest;
if (e.code() == error_code_version_already_compacted) {
TEST(true); // SimpleConfigConsumer get version_already_compacted error
wait(getSnapshotAndChanges(self, broadcaster));
} else {
throw e;

View File

@ -185,8 +185,7 @@ void FlowKnobs::initialize(Randomize _randomize, IsSimulated _isSimulated) {
init( ZERO_LENGTH_FILE_PAD, 1 );
init( TRACE_FLUSH_INTERVAL, 0.25 );
init( TRACE_RETRY_OPEN_INTERVAL, 1.00 );
// FIXME: Undo
init( MIN_TRACE_SEVERITY, isSimulated ? 1 : 5 ); // Related to the trace severity in Trace.h
init( MIN_TRACE_SEVERITY, isSimulated ? 1 : 10 ); // Related to the trace severity in Trace.h
init( MAX_TRACE_SUPPRESSIONS, 1e4 );
init( TRACE_DATETIME_ENABLED, true ); // trace time in human readable format (always real time)
init( TRACE_SYNC_ENABLED, 0 );

View File

@ -177,5 +177,6 @@ TEST_CASE("/flow/genericactors/DependentAsyncVar") {
state Future<Void> subscriber2 =
testSubscriber(IDependentAsyncVar<int>::create(input, [](auto const& var) { return var.unchanged; }), {});
wait(subscriber1 && testPublisher(input));
ASSERT(!subscriber2.isReady());
return Void();
}

View File

@ -3,5 +3,5 @@ startDelay=0
useDB=false
testName=UnitTests
maxTestCases=0
testsMatching=/status/json/builder
maxTestCases=1
testsMatching=/fdbserver/ConfigDB/