-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fuzz: add bounds to statsh flush interval #8043
Changes from 2 commits
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 |
---|---|---|
|
@@ -99,7 +99,13 @@ message Bootstrap { | |
// performance reasons Envoy latches counters and only flushes counters and | ||
// gauges at a periodic interval. If not specified the default is 5000ms (5 | ||
// seconds). | ||
google.protobuf.Duration stats_flush_interval = 7 [(gogoproto.stdduration) = true]; | ||
google.protobuf.Duration stats_flush_interval = 7 [ | ||
(validate.rules).duration = { | ||
lt: {seconds: 60}, | ||
gte: {nanos: 1000000} | ||
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. Can you add a comment here on what human readable time this is? |
||
}, | ||
(gogoproto.stdduration) = true | ||
]; | ||
|
||
// Optional watchdog configuration. | ||
Watchdog watchdog = 8; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
static_resources { | ||
clusters { | ||
name: "@" | ||
connect_timeout { | ||
nanos: 250000000 | ||
} | ||
common_lb_config { | ||
zone_aware_lb_config { | ||
min_cluster_size { | ||
value: 38 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stats_flush_interval { | ||
nanos: 32256 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#include <fstream> | ||
|
||
#include "envoy/config/bootstrap/v2/bootstrap.pb.validate.h" | ||
|
||
#include "common/network/address_impl.h" | ||
#include "common/thread_local/thread_local_impl.h" | ||
|
||
|
@@ -61,6 +63,14 @@ class AllFeaturesHooks : public DefaultListenerHooks { | |
}; | ||
|
||
DEFINE_PROTO_FUZZER(const envoy::config::bootstrap::v2::Bootstrap& input) { | ||
try { | ||
// Validate the input early. | ||
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. Do we need to validate early? I think part of the goal of this test is to ensure that the validation logic itself is happening as expected, or are you thinking that 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. I figured |
||
TestUtility::validate(input); | ||
} catch (const EnvoyException& ex) { | ||
ENVOY_LOG_MISC(debug, "Controlled EnvoyException exit: {}", ex.what()); | ||
return; | ||
} | ||
|
||
testing::NiceMock<MockOptions> options; | ||
AllFeaturesHooks hooks; | ||
testing::NiceMock<MockHotRestart> restart; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would make this much larger, like 5 minutes max?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks