-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Format Watcher.status.lastChecked and lastMetCondition #38626
Format Watcher.status.lastChecked and lastMetCondition #38626
Conversation
Change the formatting for Watcher.status.lastCheck and lastMetCondition to be the same as Watcher.status.state.timestamp. These should all have only millisecond precission
@elasticmachine run elasticsearch-ci/1 |
String lastChecked = source.getValue("status.last_checked"); | ||
assertThat(lastChecked, WatcherTestUtils.isSameDate(getWatchResponse.getStatus().lastChecked())); |
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 you also assert that the nano seconds are not present here ?
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.
sure - updated the PR
@Override | ||
protected Boolean featureValueOf(ZonedDateTime actual) { | ||
//if date has millisecond precision its nanosecond field will be rounded to millis (equal millis * 10^6) | ||
return actual.getNano() == actual.get(ChronoField.MILLI_OF_SECOND) * 1000_000; |
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.
alternatively just actual.getNano() % 1000 == 0
- not sure if it is more readable to be honest, so feel free to ignore me :-)
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.
LGTM
Change the formatting for Watcher.status.lastCheck and lastMetCondition to be the same as Watcher.status.state.timestamp. These should all have only millisecond precision closes elastic#38619
Change the formatting for Watcher.status.lastCheck and lastMetCondition to be the same as Watcher.status.state.timestamp. These should all have only millisecond precision closes elastic#38619
* master: Remove _type term filters from cluster alert watches (elastic#38819) Adjust log and unmute testFailOverOnFollower (elastic#38762) Fix line separators in JSON logging tests (elastic#38771) Fix synchronization in LocalCheckpointTracker#contains (elastic#38755) muted test Remove TLSv1.2 pinning in ssl reload tests (elastic#38651) Don't fail init script if `/proc/.../max_map_count` absent (elastic#35933) Format Watcher.status.lastChecked and lastMetCondition (elastic#38626) SQL: Implement `::` cast operator (elastic#38774) Ignore failing test
@pgomulka Is this still |
@gwbrown indeed not needed. Thank you for a remainder |
Change the formatting for Watcher.status.lastCheck and lastMetCondition
to be the same as Watcher.status.state.timestamp. These should all have
only millisecond precision
closes #38619