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

[WFLY-19286] Add ServerSetupTasks to reload server to a desired stabi… #17849

Merged
merged 2 commits into from
May 17, 2024

Conversation

kabir
Copy link
Contributor

@kabir kabir commented Apr 26, 2024

…lity level

https://issues.redhat.com/browse/WFLY-19286

This needs the Arquillian upgrade in #17832 merged before the tests can pass


More information about the wildfly-bot[bot]


}

@Override
public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be a final method with a doTearDown() to ensure the snapshot is always restored?

@kabir kabir force-pushed the WFLY-19286-reload-stability-level-tasks branch from 013ae74 to 0a88d1d Compare May 16, 2024 13:33
@kabir
Copy link
Contributor Author

kabir commented May 16, 2024

@jamezp fixed (sorry for the delay)

@wildfly-bot wildfly-bot bot requested a review from jamezp May 16, 2024 13:34
@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label May 16, 2024
Copy link
Contributor

@bstansberry bstansberry left a comment

Choose a reason for hiding this comment

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

@kabir In general this LGTM to me but...

  1. I have some minor comments
  2. Please rebase as this branch now has two unrelated commits that have equivalents that are already in main.

Please feel free to merge this when ready; i.e. don't wait for my formal approval of the above as I'll not be around for a while.

import org.junit.Assert;
import org.junit.Test;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CORE_SERVICE;
Copy link
Contributor

Choose a reason for hiding this comment

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

Static imports first.

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RELOAD_ENHANCED;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STABILITY;
import static org.jboss.as.server.controller.descriptions.ServerDescriptionConstants.SERVER_ENVIRONMENT;
import static org.junit.Assert.fail;
Copy link
Contributor

Choose a reason for hiding this comment

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

Static imports first.


import java.io.File;
import java.util.HashSet;
import java.util.Set;
Copy link
Contributor

Choose a reason for hiding this comment

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

java and javax after statics but before others

* Once the test is done, the original stability level is restored.
*
* In order to not pollute the configuration with XML from a different stability level following the run of the test,
* it takes a snapshot of the server configuration in the setup() method, and
Copy link
Contributor

Choose a reason for hiding this comment

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

and ..... ?

// Make sure the desired stability level is one of the ones supported by the server
Set<Stability> supportedStabilityLevels = getSupportedStabilityLevels(managementClient);
Assume.assumeTrue(
String.format("%s is not a supported stability level", desiredStability, supportedStabilityLevels),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a valid statement -- two vars but only one expression in the format string

node.get(ModelDescriptionConstants.OP).set("take-snapshot");
ModelNode result = client.getControllerClient().execute(node);
if (!"success".equals(result.get(ClientConstants.OUTCOME).asString())) {
fail("Reload operation didn't finish successfully: " + result.asString());
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Reload/take-snapshot

@kabir kabir force-pushed the WFLY-19286-reload-stability-level-tasks branch from 0a88d1d to 60ce0bd Compare May 17, 2024 10:00
@kabir kabir merged commit a5cedd8 into wildfly:main May 17, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes
Projects
None yet
3 participants