Skip to content

Commit

Permalink
Fix the analyzer test failure caused by inaccurate timing wait (faceb…
Browse files Browse the repository at this point in the history
…ook#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: facebook#9181

Test Plan: make check

Reviewed By: pdillinger

Differential Revision: D32511319

Pulled By: zhichao-cao

fbshipit-source-id: e694c8cb465c750cfa5a43dab3eff6707b9a11c8
  • Loading branch information
zhichao-cao authored and facebook-github-bot committed Nov 18, 2021
1 parent 74544d5 commit f429466
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/trace_analyzer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f429466

Please sign in to comment.