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

[1.3] Fix AnomalyDetectorRestApiIT.testUpdateAnomalyDetectorNameToNew #1050

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

kaituo
Copy link
Collaborator

@kaituo kaituo commented Sep 13, 2023

Description

Previously, the test checked if the new detector and the parsed new detector had different last update times. This was not the intended behavior. The correct check should be between the old and new detector's last update time. This discrepancy was mostly masked by serialization and deserialization differences, but surfaced in JDK 8 on Windows where the timestamps matched.

Changes:

  • Updated test to compare old vs. new detector's last update time.

Testing:

  • Ran gradle build.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #1050 (a347250) into 1.3 (ecb2f8c) will decrease coverage by 0.12%.
Report is 3 commits behind head on 1.3.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                1.3    #1050      +/-   ##
============================================
- Coverage     77.64%   77.53%   -0.12%     
+ Complexity     4118     4112       -6     
============================================
  Files           300      300              
  Lines         17806    17806              
  Branches       1879     1879              
============================================
- Hits          13826    13806      -20     
- Misses         3068     3085      +17     
- Partials        912      915       +3     
Flag Coverage Δ
plugin 77.53% <ø> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 7 files with indirect coverage changes

…logic

Previously, the test checked if the new detector and the parsed new detector had different last update times. This was not the intended behavior. The correct check should be between the old and new detector's last update time. This discrepancy was mostly masked by serialization and deserialization differences, but surfaced in JDK 8 on Windows where the timestamps matched.

Changes:
- Updated test to compare old vs. new detector's last update time.

Testing:
- Ran `gradle build`.

Signed-off-by: Kaituo Li <[email protected]>
@owaiskazi19
Copy link
Member

@kaituo is this change required because of JDK8? Does that mean we don't want this change on main then?

@kaituo
Copy link
Collaborator Author

kaituo commented Sep 13, 2023

@kaituo is this change required because of JDK8? Does that mean we don't want this change on main then?

@owaiskazi19 The test environment windows + JDK 8 fails the test. But this change is also required on main since the test itself has problems (see git commit description).

@owaiskazi19
Copy link
Member

@owaiskazi19 The test environment windows + JDK 8 fails the test. But this change is also required on main since the test itself has problems (see git commit description).

I see! Do we have a PR for the main branch as well?

@kaituo
Copy link
Collaborator Author

kaituo commented Sep 13, 2023

@owaiskazi19 The test environment windows + JDK 8 fails the test. But this change is also required on main since the test itself has problems (see git commit description).

I see! Do we have a PR for the main branch as well?

will send one after this PR is merged.

@owaiskazi19 owaiskazi19 merged commit b253e14 into opensearch-project:1.3 Sep 13, 2023
@owaiskazi19 owaiskazi19 changed the title Fix AnomalyDetectorRestApiIT.testUpdateAnomalyDetectorNameToNew [1.3] Fix AnomalyDetectorRestApiIT.testUpdateAnomalyDetectorNameToNew Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants