-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Fix InternalAutoDateHistogramTests #54602
Conversation
The test had errors around time units that have different length - think leap years or months that aren't 30 days. This fixes those errors. In the proces I've changed a bunch of things to debug the problem: * Replace `currentTimeMillis` with a random time. Now the test fails randomly! Wonderful. Much better than on random days of the month. * Generate buckets "closer together" to test random reduction. Without this we were super frequently getting stuck in the "year of century" rounding because *some* of the of the buckets we built were far apart. This generates a much greater variety of tests. * Implement `toString` on `RoundingInfo` so I can debug without going crazy. * Switch keys in the bucket assertions from epoch millis to `Instant`s so we can read the failures. Closes elastic#54540 Closes elastic#39497
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
I don't claim to fully understand how auto date histogram works here, but this test seems much less error prone. |
@elasticsearchmachine elasticsearch-ci/packaging-sample-unix-docker |
@elasticsearchmachine run elasticsearch-ci/packaging-sample-unix-docker |
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 this looks good to merge, but I worry that the test is still brittle. Maybe we can do a follow up, or at least open a ticket, to just add some known value tests to the suite to cover common case. Thanks for fixing this!
Thanks for reviewing @not-napoleon! I'll look into building some more exact test cases that are more readable. Even that is fairly complex. |
The test had errors around time units that have different length - think leap years or months that aren't 30 days. This fixes those errors. In the proces I've changed a bunch of things to debug the problem: * Replace `currentTimeMillis` with a random time. Now the test fails randomly! Wonderful. Much better than on random days of the month. * Generate buckets "closer together" to test random reduction. Without this we were super frequently getting stuck in the "year of century" rounding because *some* of the of the buckets we built were far apart. This generates a much greater variety of tests. * Implement `toString` on `RoundingInfo` so I can debug without going crazy. * Switch keys in the bucket assertions from epoch millis to `Instant`s so we can read the failures. Closes elastic#54540 Closes elastic#39497
The test had errors around time units that have different length - think leap years or months that aren't 30 days. This fixes those errors. In the proces I've changed a bunch of things to debug the problem: * Replace `currentTimeMillis` with a random time. Now the test fails randomly! Wonderful. Much better than on random days of the month. * Generate buckets "closer together" to test random reduction. Without this we were super frequently getting stuck in the "year of century" rounding because *some* of the of the buckets we built were far apart. This generates a much greater variety of tests. * Implement `toString` on `RoundingInfo` so I can debug without going crazy. * Switch keys in the bucket assertions from epoch millis to `Instant`s so we can read the failures. Closes elastic#54540 Closes elastic#39497
The test had errors around time units that have different length - think leap years or months that aren't 30 days. This fixes those errors. In the proces I've changed a bunch of things to debug the problem: * Replace `currentTimeMillis` with a random time. Now the test fails randomly! Wonderful. Much better than on random days of the month. * Generate buckets "closer together" to test random reduction. Without this we were super frequently getting stuck in the "year of century" rounding because *some* of the of the buckets we built were far apart. This generates a much greater variety of tests. * Implement `toString` on `RoundingInfo` so I can debug without going crazy. * Switch keys in the bucket assertions from epoch millis to `Instant`s so we can read the failures. Closes #54540 Closes #39497
The test had errors around time units that have different length - think leap years or months that aren't 30 days. This fixes those errors. In the proces I've changed a bunch of things to debug the problem: * Replace `currentTimeMillis` with a random time. Now the test fails randomly! Wonderful. Much better than on random days of the month. * Generate buckets "closer together" to test random reduction. Without this we were super frequently getting stuck in the "year of century" rounding because *some* of the of the buckets we built were far apart. This generates a much greater variety of tests. * Implement `toString` on `RoundingInfo` so I can debug without going crazy. * Switch keys in the bucket assertions from epoch millis to `Instant`s so we can read the failures. Closes #54540 Closes #39497
The test had errors around time units that have different length - think
leap years or months that aren't 30 days. This fixes those errors. In
the proces I've changed a bunch of things to debug the problem:
currentTimeMillis
with a random time. Now the test failsrandomly! Wonderful. Much better than on random days of the month.
this we were super frequently getting stuck in the "year of century"
rounding because some of the of the buckets we built were far apart.
This generates a much greater variety of tests.
toString
onRoundingInfo
so I can debug without goingcrazy.
Instant
sso we can read the failures.
Closes #54540
Closes #39497