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
main
Maysam Yabandeh 5 years ago committed by Facebook Github Bot
parent 48a678b7c9
commit 7c98d71567
  1. 1
      db_stress_tool/batched_ops_stress.cc
  2. 4
      db_stress_tool/cf_consistency_stress.cc
  3. 1
      db_stress_tool/db_stress_test_base.cc
  4. 3
      db_stress_tool/no_batched_ops_stress.cc

@ -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);
}

@ -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;

@ -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;
}

@ -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;

Loading…
Cancel
Save