Fix the analyzer test failure caused by inaccurate timing wait (#9181)

Summary:
Fix the analyzer test failure caused by inaccurate timing wait. The wait time at different system might be different or cause the delay, now we do not accurately count the lines. Only in a very rare extreme case, test will ignore the part exceed the timing of 1 second.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9181

Test Plan: make check

Reviewed By: pdillinger

Differential Revision: D32511319

Pulled By: zhichao-cao

fbshipit-source-id: e694c8cb465c750cfa5a43dab3eff6707b9a11c8
main
Zhichao Cao 3 years ago committed by Facebook GitHub Bot
parent 74544d582f
commit f4294669e0
  1. 4
      tools/trace_analyzer_test.cc

@ -162,8 +162,8 @@ class TraceAnalyzerTest : public testing::Test {
ASSERT_OK(lf_reader.GetStatus());
ASSERT_EQ(cnt.size(), result.size());
for (int i = 0; i < static_cast<int>(result.size()); i++) {
size_t min_size = std::min(cnt.size(), result.size());
for (size_t i = 0; i < min_size; i++) {
if (full_content) {
ASSERT_EQ(result[i], cnt[i]);
} else {

Loading…
Cancel
Save