Print before AddErrors in stress tests (#6256)

Summary:
Stress tests count number of errors and report them at the end. Not all the cases are accompanied with a log line which makes debugging difficult. The patch adds a log line to the remaining cases.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6256

Differential Revision: D19268785

Pulled By: maysamyabandeh

fbshipit-source-id: bdabcaa5c5c7edcb4ce4f25e38fd8a3fd9c7700b
This commit is contained in:
Maysam Yabandeh 2020-01-02 16:43:55 -08:00 committed by Facebook Github Bot
parent 48a678b7c9
commit 7c98d71567
4 changed files with 9 additions and 0 deletions

View File

@ -325,6 +325,7 @@ class BatchedOpsStressTest : public StressTest {
if (s.ok()) {
thread->stats.AddPrefixes(1, count);
} else {
fprintf(stderr, "TestPrefixScan error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
}

View File

@ -184,6 +184,7 @@ class CfConsistencyStressTest : public StressTest {
db_->ReleaseSnapshot(snapshot);
}
if (!is_consistent) {
fprintf(stderr, "TestGet error: is_consistent is false\n");
thread->stats.AddErrors(1);
// Fail fast to preserve the DB state.
thread->shared->SetVerificationFailure();
@ -192,6 +193,7 @@ class CfConsistencyStressTest : public StressTest {
} else if (s.IsNotFound()) {
thread->stats.AddGets(1, 0);
} else {
fprintf(stderr, "TestGet error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
}
return s;
@ -225,6 +227,7 @@ class CfConsistencyStressTest : public StressTest {
thread->stats.AddGets(1, 0);
} else {
// errors case
fprintf(stderr, "MultiGet error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
}
}
@ -263,6 +266,7 @@ class CfConsistencyStressTest : public StressTest {
if (s.ok()) {
thread->stats.AddPrefixes(1, count);
} else {
fprintf(stderr, "TestPrefixScan error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
}
delete iter;

View File

@ -955,6 +955,7 @@ Status StressTest::TestIterate(ThreadState* thread,
if (s.ok()) {
thread->stats.AddIterations(1);
} else {
fprintf(stderr, "TestIterate error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
break;
}

View File

@ -147,6 +147,7 @@ class NonBatchedOpsStressTest : public StressTest {
thread->stats.AddGets(1, 0);
} else {
// errors case
fprintf(stderr, "TestGet error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
}
return s;
@ -243,6 +244,7 @@ class NonBatchedOpsStressTest : public StressTest {
thread->stats.AddGets(1, 0);
} else {
// errors case
fprintf(stderr, "MultiGet error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
}
}
@ -277,6 +279,7 @@ class NonBatchedOpsStressTest : public StressTest {
if (iter->status().ok()) {
thread->stats.AddPrefixes(1, count);
} else {
fprintf(stderr, "TestPrefixScan error: %s\n", s.ToString().c_str());
thread->stats.AddErrors(1);
}
delete iter;