-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[server] add unused ENVOY_BUG implementation #11503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
ff7ca4f
798bb0e
8f9aba6
1ed929d
e3b47af
c5ab825
00e851e
26cbe25
1adce9f
ce70b00
aacf835
b56f27f
f84faf9
e598f28
9f036bb
4b2b808
6ba5df6
82afac3
2b1e871
3cdbc57
2d2f5ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,4 +42,29 @@ TEST(AssertDeathTest, VariousLogs) { | |
| EXPECT_EQ(expected_counted_failures, assert_fail_count); | ||
| } | ||
|
|
||
| TEST(EnvoyBugDeathTest, VariousLogs) { | ||
| int expected_counted_failures; | ||
| int envoy_bug_fail_count = 0; | ||
| // ENVOY_BUG actions only occur on power of two counts. | ||
| auto envoy_bug_action_registration = | ||
| Assert::setEnvoyBugFailureRecordAction([&]() { envoy_bug_fail_count++; }); | ||
|
|
||
| #ifndef NDEBUG | ||
| EXPECT_DEATH({ ENVOY_BUG(0); }, ".*envoy bug failure: 0.*"); | ||
| EXPECT_DEATH({ ENVOY_BUG(0, ""); }, ".*envoy bug failure: 0.*"); | ||
| EXPECT_DEATH({ ENVOY_BUG(0, "With some logs"); }, | ||
| ".*envoy bug failure: 0. Details: With some logs.*"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. informational only, no action needed: There's something interesting about ENVOY_BUG in debug modes that we may want to comment about here: Possible suggestion: it would be good to have macros that make it easier to test for code triggering ENVOY_BUG. I guess we can use EXPECT_DEBUG_DEATH until a more specialized macro exists. |
||
| expected_counted_failures = 0; | ||
| #else | ||
| EXPECT_LOG_CONTAINS("error", "envoy bug failure: 0", ENVOY_BUG(0)); | ||
|
asraa marked this conversation as resolved.
Outdated
|
||
| EXPECT_LOG_CONTAINS("error", "envoy bug failure: 0", ENVOY_BUG(0)); | ||
| EXPECT_LOG_CONTAINS("error", "envoy bug failure: 0", ENVOY_BUG(0)); | ||
| EXPECT_LOG_CONTAINS("error", "envoy bug failure: 0", ENVOY_BUG(0, "")); | ||
| EXPECT_LOG_CONTAINS("error", "envoy bug failure: 0. Details: With some logs", | ||
| ENVOY_BUG(0, "With some logs")); | ||
| expected_counted_failures = 3; | ||
| #endif | ||
| EXPECT_EQ(expected_counted_failures, envoy_bug_fail_count); | ||
| } | ||
|
|
||
| } // namespace Envoy | ||
Uh oh!
There was an error while loading. Please reload this page.