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

Fix LocalTranslogTests.testWithRandomException test scenario #6748

Merged
merged 4 commits into from
Apr 20, 2023

Conversation

mitrofmep
Copy link
Contributor

@mitrofmep mitrofmep commented Mar 18, 2023

Description

Set TragicException in case of simulated Runtime Exception for asserting and passing test LocalTranslogTests.testWithRandomException

Issues Resolved

Resolves #6625

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@dblock
Copy link
Member

dblock commented Mar 24, 2023

Please sign DCO/iterate to green. Thanks!

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>
@mitrofmep
Copy link
Contributor Author

Please sign DCO/iterate to green. Thanks!

Done)

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2023

Codecov Report

Merging #6748 (42f2d8a) into main (59e881b) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 42f2d8a differs from pull request most recent head 964887f. Consider uploading reports for the commit 964887f to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6748      +/-   ##
============================================
- Coverage     70.77%   70.76%   -0.01%     
+ Complexity    59270    59236      -34     
============================================
  Files          4822     4822              
  Lines        283940   283940              
  Branches      40947    40947              
============================================
- Hits         200963   200935      -28     
+ Misses        66454    66402      -52     
- Partials      16523    16603      +80     

see 473 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dblock
Copy link
Member

dblock commented Mar 27, 2023

@mitrofmep Do you think you could add a test that always hits this code?

@mitrofmep
Copy link
Contributor Author

@mitrofmep Do you think you could add a test that always hits this code?

Sure! Proceeding from this case, is it ok if I'll create a copy of this test LocalTranslogTests.testWithRandomException, but change random values to exact values, that are passed to test in case of "problem" seed?

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=indices.split/30_copy_settings/Copy settings during split index}
      1 org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=indices.shrink/30_copy_settings/Copy settings during shrink index}

@dbwiddis
Copy link
Member

dbwiddis commented Apr 2, 2023

@mitrofmep Do you think you could add a test that always hits this code?

Hey @dblock I independently tracked this one down, and the existing random tests do trigger this; it's 100% reproducible with the seed given in the failed log builds. (Call heirarchy confirms it fails 1 in 100 times.) I don't think an additional test is needed, and I think the fix is correct here (the test expects the failure tracked in "tragic" but it's just a plain exception.

@dbwiddis
Copy link
Member

dbwiddis commented Apr 2, 2023

I might note that the "expected" and "actual" fields in the assertEquals() associated with this failure (and all in this test method) are reversed, which makes debugging slightly confusing. I wouldn't mind if those were switched to their correct order in this PR.

@dblock
Copy link
Member

dblock commented Apr 3, 2023

@mitrofmep Do you think you could add a test that always hits this code?

Hey @dblock I independently tracked this one down, and the existing random tests do trigger this; it's 100% reproducible with the seed given in the failed log builds. (Call heirarchy confirms it fails 1 in 100 times.) I don't think an additional test is needed, and I think the fix is correct here (the test expects the failure tracked in "tragic" but it's just a plain exception.

Let's agree to disagree. When tests pass 99% of the time means we can introduce a regression and catch it only 1% of the time (we got lucky here!). I'll merge either way.

@dblock
Copy link
Member

dblock commented Apr 3, 2023

@mitrofmep LMK if you want me to merge as is or fix the order of the check that @dbwiddis suggests (and write a test that always fails without this fix as I do? :))

@mitrofmep mitrofmep force-pushed the main branch 2 times, most recently from 39758ea to 42f2d8a Compare April 5, 2023 06:42
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

@mitrofmep
Copy link
Contributor Author

mitrofmep commented Apr 5, 2023

@mitrofmep LMK if you want me to merge as is or fix the order of the check that @dbwiddis suggests (and write a test that always fails without this fix as I do? :))

Hello, @dblock! Could you merge it as is for now, and we can add this always falling test later. I also reversed "actual" and "expected" fields, as @dbwiddis mentioned.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.action.admin.cluster.node.tasks.ResourceAwareTasksTests.testTaskResourceTrackingDuringTaskCancellation

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

@kotwanikunal kotwanikunal changed the title fix #6625 Fix LocalTranslogTests.testWithRandomException test scenario Apr 12, 2023
@mitrofmep
Copy link
Contributor Author

@dblock, is it okay for merging now, or should I add something else?

@dblock dblock merged commit 4afc914 into opensearch-project:main Apr 20, 2023
@dblock dblock added the backport 2.x Backport to 2.x branch label Apr 20, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 20, 2023
* fix #6625

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>

* fix #6625 - reverse assertEquals params

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>

---------

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>
(cherry picked from commit 4afc914)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Rishikesh1159 pushed a commit that referenced this pull request Apr 25, 2023
…7263)

* fix #6625



* fix #6625 - reverse assertEquals params



---------


(cherry picked from commit 4afc914)

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
austintlee pushed a commit to austintlee/OpenSearch that referenced this pull request Apr 28, 2023
…rch-project#6748)

* fix opensearch-project#6625

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>

* fix opensearch-project#6625 - reverse assertEquals params

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>

---------

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…rch-project#6748)

* fix opensearch-project#6625

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>

* fix opensearch-project#6625 - reverse assertEquals params

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>

---------

Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failure: LocalTranslogTests.testWithRandomException
4 participants