diff options
author | Shashi Shekhar <shashishekhar@google.com> | 2018-04-26 16:11:11 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-26 16:14:09 -0700 |
commit | bcefec3d6782365510c45e08763892d478dabb07 (patch) | |
tree | 0029eb8cf061f9abcb5ab3e5303ee531f1e152d5 /tensorflow/contrib/lite/profiling | |
parent | 04a5547817ad758cc7c32cd580335fd2e8a5e1e6 (diff) |
Fix some flakiness in test.
PiperOrigin-RevId: 194470125
Diffstat (limited to 'tensorflow/contrib/lite/profiling')
-rw-r--r-- | tensorflow/contrib/lite/profiling/profiler_test.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tensorflow/contrib/lite/profiling/profiler_test.cc b/tensorflow/contrib/lite/profiling/profiler_test.cc index 7914f36a31..7ea1d8f7d3 100644 --- a/tensorflow/contrib/lite/profiling/profiler_test.cc +++ b/tensorflow/contrib/lite/profiling/profiler_test.cc @@ -82,16 +82,15 @@ TEST(ProfilingTest, ProfilesAreCollected) { EXPECT_EQ("Child", profile_events[3]->tag); EXPECT_EQ("SleepForQuarter", profile_events[4]->tag); - AssertDurationOfEventAroundMs(profile_events[0], /*expected_ms*/ 500, - /*eps_ms*/ 2); - AssertDurationOfEventAroundMs(profile_events[1], /*expected_ms*/ 250, - /*eps_ms*/ 2); - AssertDurationOfEventAroundMs(profile_events[2], /*expected_ms*/ 250, - /*eps_ms*/ 2); - AssertDurationOfEventAroundMs(profile_events[3], /*expected_ms*/ 250, - /*eps_ms*/ 2); - AssertDurationOfEventAroundMs(profile_events[4], /*expected_ms*/ 250, - /*eps_ms*/ 2); +#ifndef ADDRESS_SANITIZER + // ASAN build is sometimes very slow. + const int eps_ms = 10; + AssertDurationOfEventAroundMs(profile_events[0], /*expected_ms*/ 500, eps_ms); + AssertDurationOfEventAroundMs(profile_events[1], /*expected_ms*/ 250, eps_ms); + AssertDurationOfEventAroundMs(profile_events[2], /*expected_ms*/ 250, eps_ms); + AssertDurationOfEventAroundMs(profile_events[3], /*expected_ms*/ 250, eps_ms); + AssertDurationOfEventAroundMs(profile_events[4], /*expected_ms*/ 250, eps_ms); +#endif } } // namespace |