-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[Test] Move archived setting test into its own test class #116460
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
Conversation
As title says, the archived setting needs to be removed to not interfere with other test methods in the same test class. Resolves: elastic#111798 Resolves: elastic#111777 Resolves: elastic#111774 Resolves: elastic#111799
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
|
Oh joy. Looks like the fix did not work. Let me take another look. |
|
I pushed more changes for the fix 6eaca3c
|
| public int compare(TestMethodAndParams o1, TestMethodAndParams o2) { | ||
| return Integer.compare( | ||
| o1.getTestMethod().getAnnotation(Order.class).value(), | ||
| o2.getTestMethod().getAnnotation(Order.class).value() | ||
| ); | ||
| return Integer.compare(getOrderValue(o1.getTestMethod()), getOrderValue(o2.getTestMethod())); | ||
| } | ||
|
|
||
| private int getOrderValue(Method method) { | ||
| return method.isAnnotationPresent(Order.class) ? method.getAnnotation(Order.class).value() : Integer.MAX_VALUE; | ||
| } |
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.
This maybe controversial. It essentially allows annotating Order for a subset of tests instead of all the tests. Missing Order annotation defaults to Integer.MAX_VALUE, i.e. they run last. I am trying to avoid annotating every method in FullClusterRestartIT. It is really needed for just one method. The rest can run in whatever order. I also considered splitting the single method into a different test class. But CoreFullClusterRestartIT extends FullClusterRestartIT which means we need yet another test class to extends the new test class. Seems not worth it. So I went with this approach.
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.
Nevermind. I just noticed the full-cluster-restart package has its own FullClusterRestartTestOrdering annotation. So I have moved the changes into it which should be less of an issue. The tests also need to respect the ordering determined by old and new cluster as well.
|
@DaveCTurner Now I am getting a new failure which I suspect is a legitimate issue. The important bit of the exception is IIUC, this means users cannot restore a snapshot taken on an old cluster if it has a less than 1.0 value for persistent setting |
DaveCTurner
left a comment
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.
Ah this is unfortunate. I think my preferred solution would be to run this specific test case in a separate Gradle project so it does not interfere with these other tests.
In the meantime, I'd suggest muting the problematic test case and unmuting the ones that were muted in error.
|
Once |
|
Raised #116558 for the validation issue |
| * version is started with the same data directories and then this is rerun | ||
| * with {@code tests.is_old_cluster} set to {@code false}. | ||
| */ | ||
| public class FullClusterRestartArchivedSettingsIT extends ParameterizedFullClusterRestartTestCase { |
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 didn't add a subclass for this new test class in x-pack because it does not seem necessary. The archived settings do not depend on whether security is enabled. But please let me know if you think have one to pair the coverage.
...t/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartArchivedSettingsIT.java
Outdated
Show resolved
Hide resolved
| 8.15.1,8512000 | ||
| 8.15.2,8512000 | ||
| 8.15.3,8512000 | ||
| 8.15.4,8512000 |
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.
Is this needed 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.
Yes. Otherwise the test would fail with a message similar to the following
java.lang.AssertionError:
Expected: (<[8.14.4]> or <[8512000]> or <[8.14.0-8.14.4]>)
but: was <[8.14.0-8.14.3]>
See #111777 for an example.
@mark-vieira Could you please take a look at this change and make sure it is OK to update it manually like this?
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 I understand why this change needs to be made, I just don't understand why it's happening in this PR. Shouldn't this be added by the release process?
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.
Shouldn't this be added by the release process?
I have the same question. That's reason I requested @mark-vieira 's review. Maybe I should have tagged @elastic/es-delivery
Also ping @thecoop since #111777 is assigned to you. Thank you!
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.
The build automation I think is not quite working properly with the multiple release branches we have going on at the moment - there's also #114972. I need to look at this properly, but these should be added in a separate PR so we can confirm that it is actually the right thing to do at the right time (and backport it appropriately too)
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.
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.
Errr the tests now complain about 8.16.1 which is not yet in the versions file. 😿
Expected: (<[8.16.1]> or <[8518000]> or <[8.16.0]>) |
but: was <[8.16.0-8.16.1]>
Cannot really move this PR forward without the versions to be fixed first.
| 8.15.1,8512000 | ||
| 8.15.2,8512000 | ||
| 8.15.3,8512000 | ||
| 8.15.4,8512000 |
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 I understand why this change needs to be made, I just don't understand why it's happening in this PR. Shouldn't this be added by the release process?
DaveCTurner
left a comment
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.
LGTM2
I expect the bwc test failures relate to the recent release of 8.16.0 - they should be addressed in main (soon, if not already, I haven't checked) and then this can be merged in its current state.
|
The version check failure has been resolved by #116727 |
💔 Backport failedThe backport operation could not be completed due to the following error: You can use sqren/backport to manually backport by running |
…6460) As title says, the archived setting needs to be moved out to not interfere with other test methods in the same test class. Resolves: elastic#111798 Resolves: elastic#111777 Resolves: elastic#111774 Resolves: elastic#111799 (cherry picked from commit a7878a9) # Conflicts: # muted-tests.yml # qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartIT.java
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…6460) As title says, the archived setting needs to be moved out to not interfere with other test methods in the same test class. Resolves: elastic#111798 Resolves: elastic#111777 Resolves: elastic#111774 Resolves: elastic#111799
…6460) As title says, the archived setting needs to be moved out to not interfere with other test methods in the same test class. Resolves: elastic#111798 Resolves: elastic#111777 Resolves: elastic#111774 Resolves: elastic#111799
As title says, the archived setting needs to be moved out to not interfere with other test methods in the same test class.
Resolves: #111798
Resolves: #111777
Resolves: #111774
Resolves: #111799