fuzz: avoid leaking time system singleton.#5850
Merged
jmarantz merged 4 commits intoenvoyproxy:masterfrom Feb 6, 2019
Merged
Conversation
Previously we were seeing: FAIL: Active singletons exist: Unexpected active singleton: N5Envoy5Event25SingletonTimeSystemHelperE at the end of each fuzz test. Risk level: Low Testing: bazel test //test/common/access_log:access_log_formatter_fuzz_test --test_output=streamed --test_arg="-l trace" -c dbg --config=clang-asan --test_output=all Signed-off-by: Harvey Tuch <htuch@google.com>
htuch
commented
Feb 5, 2019
Member
Author
htuch
left a comment
There was a problem hiding this comment.
Q: should we RELEASE_ASSERT on TestBase::checkSingletonQuiescensce? The reason we didn't catch it is this is a soft fail today.
jmarantz
reviewed
Feb 5, 2019
test/fuzz/main.cc
Outdated
| } | ||
| // Cleanup before we jump into the tests, the test API creates a singleton time system that we | ||
| // don't want to leak into gtest. | ||
| api.reset(); |
Contributor
There was a problem hiding this comment.
This works. You could also put the entire stanza above into a helper function or a scope.
jmarantz
previously approved these changes
Feb 5, 2019
Signed-off-by: Harvey Tuch <htuch@google.com>
jmarantz
reviewed
Feb 5, 2019
test/test_common/test_base.h
Outdated
| public: | ||
| ~TestBaseWithParam() { TestBase::checkSingletonQuiescensce(); } | ||
| ~TestBaseWithParam() { | ||
| RELEASE_ASSERT(TestBase::checkSingletonQuiescensce(), "active singletons exist"); |
Contributor
There was a problem hiding this comment.
OK this is good...I was thinking about ASSERT_TRUE(...) or EXPECT_TRUE(...) here so that further tests would continue to run. But maybe it's hard to reason about more tests when there are leaks in the current one.
jmarantz
previously approved these changes
Feb 5, 2019
Signed-off-by: Harvey Tuch <htuch@google.com>
jmarantz
reviewed
Feb 5, 2019
| Envoy::test_corpus_.emplace_back(arg); | ||
| // Ensure we cleanup API resources before we jump into the tests, the test API creates a singleton | ||
| // time system that we don't want to leak into gtest. | ||
| { |
Contributor
There was a problem hiding this comment.
can you sink stats_store too?
Signed-off-by: Harvey Tuch <htuch@google.com>
jmarantz
approved these changes
Feb 6, 2019
fredlas
pushed a commit
to fredlas/envoy
that referenced
this pull request
Mar 5, 2019
* fuzz: avoid leaking time system singleton. Previously we were seeing: FAIL: Active singletons exist: Unexpected active singleton: N5Envoy5Event25SingletonTimeSystemHelperE at the end of each fuzz test. Risk level: Low Testing: bazel test //test/common/access_log:access_log_formatter_fuzz_test --test_output=streamed --test_arg="-l trace" -c dbg --config=clang-asan --test_output=all Signed-off-by: Harvey Tuch <htuch@google.com> Signed-off-by: Fred Douglas <fredlas@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously we were seeing:
FAIL: Active singletons exist:
Unexpected active singleton: N5Envoy5Event25SingletonTimeSystemHelperE
at the end of each fuzz test.
Risk level: Low
Testing: bazel test //test/common/access_log:access_log_formatter_fuzz_test --test_output=streamed
--test_arg="-l trace" -c dbg --config=clang-asan --test_output=all
Signed-off-by: Harvey Tuch htuch@google.com