Skip to content
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

Merged
merged 6 commits into from
Feb 12, 2019

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Feb 8, 2019

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

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
@pgomulka pgomulka added >test-failure Triaged test failures from CI v7.0.0 v8.0.0 v7.2.0 labels Feb 8, 2019
@pgomulka pgomulka self-assigned this Feb 8, 2019
@pgomulka
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/1

String lastChecked = source.getValue("status.last_checked");
assertThat(lastChecked, WatcherTestUtils.isSameDate(getWatchResponse.getStatus().lastChecked()));
Copy link
Contributor

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 ?

Copy link
Contributor Author

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;
Copy link
Contributor

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 :-)

Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pgomulka pgomulka merged commit c69ef39 into elastic:master Feb 12, 2019
pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Feb 12, 2019
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
pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Feb 12, 2019
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
pgomulka added a commit that referenced this pull request Feb 12, 2019
…ort#38626

The hardcoded '\n' in string will not work in Windows where there is a
different line separator. A System.lineSeparator should be used to make
it work on all platforms
closes #38705
backport #38626
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Feb 13, 2019
* 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 added a commit that referenced this pull request Feb 13, 2019
…ort#38626

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
backport #38626
@gwbrown
Copy link
Contributor

gwbrown commented Apr 8, 2019

@pgomulka Is this still backport pending? It looks like it's been merged to all appropriate branches.

@pgomulka
Copy link
Contributor Author

pgomulka commented Apr 9, 2019

@gwbrown indeed not needed. Thank you for a remainder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] Occasional failures WatchStatusIntegrationTests#testThatStatusGetsUpdated
6 participants