-
Notifications
You must be signed in to change notification settings - Fork 460
Shared mini test suite minor follow on #5555
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
Shared mini test suite minor follow on #5555
Conversation
|
||
@AfterAll | ||
public static void teardown() { | ||
SharedMiniClusterBase.stopMiniCluster(); | ||
} |
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.
super class already has this AfterAll. Just removed since not needed twice
- Noticed several SharedMiniClusterBase ITs were not calling `stopMiniCluster()`. All tests which start a mini cluster now stop the mini cluster as well. - Added some javadoc changes to SharedMiniClusterBase and SimpleSharedMacTestSuite - Misc. other minor changes
36d2bec
to
55cbd08
Compare
@kevinrr888 - do you want to try and resolve @ctubbsii's comment as part of this PR? If not, I can take a look at it in a different one. |
@dlmarion - I can look into adding that in this PR |
// subsequent tests that count objects or initiate | ||
// compactions and wait for them, but some other table | ||
// from a prior test is compacting. | ||
// If stop is disabled, then we are likely running a test class that is part of a larger |
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 wonder if this should also reset the system config (and any table config affecting accumulo.* tables)?
I took a look at this today, because it got in the way of running an explicit test I tried to run with <profile>
<id>shared-mini-suite-its</id>
<activation>
<property>
<name>!test</name>
</property>
<property>
<name>!it.test</name>
</property>
<property>
<name>!groups</name>
</property>
<property>
<name>!excludedGroups</name>
</property>
<!-- etc.... -->
</activation> However, this won't work for the sunny profile, because the profile activation checks run before the sunny profile can set the SunnyDay groups property. A better option would be to set the second execution in a separate Maven module by moving all these tests to a different module. That's a bit frustrating, and comes with its own downsides, but it would allow us to honor user-specified command-line options by making the plugin behavior driven by properties, rather than hard-coded values that affect the plugin. An alternative would be to create a suite of new properties that are specific to this execution, and hard-code them into the execution's config, as in: <execution>
<configuration>
<test>${sharedMiniTest}</test>
<groups>${sharedMiniGroups}</groups>
<excludedGroups>${sharedMiniExcludedGroups}</excludedGroups>
<!-- etc... --> Another option is to have only the suite entry point test be available for selection, and don't treat it like a separate group. That would require renaming all the ITs in that suite, so they don't get picked up by the None of these seem like great options to me, but something needs to be done to make it possible to run individual tests again without picking up all the suite tests, because they are hard-coded to run every time, regardless of user input. Because of how disruptive it is to not be able to run individual tests, I'm considering reverting the commit that added the suite, unless we can get some workable solution soon. The time savings in Jenkins is not substantial enough to warrant that loss of functionality, in my opinion. |
- Removed failsafe plugin from <build><plugins> - Replaced with two profiles: One which runs the specific ITs provoided via it.test variable. One which runs all ITs: first the suite then all other tests excluding the suite. This adds support to running specific ITs via it.test without running the entire suite, which was not the case before. This also allows running specific ITs that are part of the suite without them being excluded.
@ctubbsii - I just pushed what I thought might be a fix for this issue before seeing your comment... Looking over your comment now. |
@ctubbsii - What are your thoughts on 8d0be6d? Maybe this meets some of the expectations and can be altered to meet all. With this, can run individual ITs (including those that are part of the suite) without running any other tests. As for the problem you mentioned with -Psunny, maybe this wasn't the case before but with the newest commit, if you run -Psunny, it will execute I'm sure my approach has problems, as the Accumulo build and maven in general is fairly new to me. If you have an alternative approach that you would like to see, please feel free to push a commit. |
That addresses some things. However, the second execution should not be configured in the parent POM at all. It should only exist in the test module, since that's where the second execution is occurring (most modules do not need a second execution). Also, even with these changes, it will still run when specifying a subset of tests a different way (using I think a simpler approach would be rename the tests included in the suite, so they automatically get skipped by default, and the suite itself is still named ending in IT, so it gets included by default. So the suite is all-or-nothing, but not in a separate execution, but in the same normal execution where you can still specify individual tests (even if they don't follow the naming convention) by using |
@@ -139,6 +139,7 @@ public static void afterTests() throws Exception { | |||
if (testLock != null) { | |||
testLock.unlock(); | |||
} | |||
stopMiniCluster(); |
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 might need to be backported to 2.1
@AfterAll | ||
public static void afterTests() { | ||
stopMiniCluster(); | ||
} | ||
|
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 might need to be backported to 2.1
@@ -110,6 +110,7 @@ public static void beforeAll() throws Exception { | |||
@AfterAll | |||
public static void afterAll() { | |||
client.close(); | |||
SharedMiniClusterBase.stopMiniCluster(); |
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 might need to be backported to 2.1
@@ -116,6 +116,7 @@ public static void beforeAll() throws Exception { | |||
|
|||
@AfterAll | |||
public static void after() throws Exception { | |||
SharedMiniClusterBase.stopMiniCluster(); |
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 might need to be backported to 2.1
On a phone call with @kevinrr888 , we discussed the following plan, that I think will satisfy everything we want out of this.
I think this gets us everything we want, such as:
I also think that if this works out well, that we could do something similar with ComprehensiveIT, so it doesn't need to be all contained in the same file, but could be split up for organizational purposes, and ComprehensiveIT could be a suite. |
The only real downsides I can think of for the suite approach is the inconvenience of having a custom naming conventions for the included suite test cases, and the fact that automatically rerunning a failed flaky test inside the suite with the |
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.
While this didn't accomplish the original goal, that's okay, I think the javadoc and typo fixes, and dependency scope change, are all good fixes, as are the stopping the unstopped mini instances at the end of tests (but some of those probably need to be backported to 2.1).
Brief background: #5536 added a suite to run many of the SharedMiniClusterBase ITs against a single, shared cluster.
The test suite currently includes the ITs which do not set a custom config prior to start up (i.e., those that call
SharedMiniClusterBase.startMiniCluster()
). This PR was originally going to add the shared mini ITs which set a custom config to the new test suite (i.e., those that callSharedMiniClusterBase.startMiniClusterWithConfig()
). However, almost all of the tests which start with a config (except for ~5) change something about server configuration which is needed before starting the servers (e.g., setting the number of servers, setting max memory, changing the class used for the server, etc.). I could not come up with a way to include these in the suite without adding complexity to the ITs (e.g., need to keep track of what servers are configured differently from standard, how many "extra" servers are created, etc.). On top of that, we would still need to restart affected servers after the IT completes. I felt this complexity and the fact restarts were still needed, it was not worth trying to add these to the suite.So, this PR just adds some trivial improvements that I made when working on this:
stopMiniCluster()
. All tests which start a mini cluster now stop the mini cluster as well.