-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Rewrite of throttling logging appender testing #2458
Conversation
- Renamed test class to match the class it is testing (ThrottlingAppenderWrapper). - Rewrote class to play nicer with slower processing and to improve long term supportability. - Relied on system property for line seperation instead of hardcoded regex. - Removed unused imports (and in the class being tested as well).
The reason for this PR was discussed in another PR I submitted that had CI fail due to the issues addressed by this PR (see #2451). |
Interesting, CI failed on unrelated code (you can see the test affected by this PR was successful):
Here is the specific failure:
I suspect there is a resource/socket somewhere from another test that failed to be cleaned up or something else holding the desired listening port. It seems to be specific to the AppVeyor CI as my previous commit failed at the exact same spot for the same CI solution. |
Huh, what's weird is that the code sets the |
I haven't dug too deeply into the issue; I have the same failure in two builds on the same CI system (my first commit and then my second to remove an additional unused import I missed on my first pass). It is possible there is something messed up specific to the AppVeyor instance. |
// add one regardless as at full speed, we end up with 1 + executed | ||
// intervals as an event fires at time zero. | ||
int high = (int) intervals; | ||
if ((intervals - high > 0d)) { |
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.
Can this be written more straightforward with something like Math.ceil
? a la
int high = (int)Math.ceil(intervals) + 1
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. Commit inbound.
Yeah maybe we'll just keep an eye on the appveyor flakiness. Hopefully it'll be just that one time. I tested this PR on my windows machine and everything passed, so don't worry. |
It looks like AppVeyor worked this time! |
Excellent, thank you! I certainly liked the way structured the test so it becomes resilient to variable CI environments. |
Thank you sir! |
Extract `ThrottlingAppenderWrapper` from Dropwizard and keep it as a separate (tiny) project. Refs dropwizard/dropwizard#2376 Refs dropwizard/dropwizard#2384 Refs dropwizard/dropwizard#2458
(ThrottlingAppenderWrapper).
term supportability.
regex.
Problem:
The current unit test relies on wall clock timings which can cause issues during CI builds on slow machines.
Solution:
I've done my best to eliminate wall clock where possible and added calculations where that wasn't possible to dynamically calculate the expected result for slow machines.
Result:
The tests should be far more reliable.