-
Notifications
You must be signed in to change notification settings - Fork 217
OWLS-86407 - Fixed the logic to start clustered managed server pods when admin server pod not running #2093
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
Changes from all commits
a1f8aa8
848221c
b1214a3
d6821af
cffde40
94a5967
6cc0719
482dc9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ private static String getManagedServerName(int n) { | |
private final Step nextStep = new TerminalStep(); | ||
private final KubernetesTestSupport testSupport = new KubernetesTestSupport(); | ||
private final List<Memento> mementos = new ArrayList<>(); | ||
private final DomainPresenceInfo domainPresenceInfo = createDomainPresenceInfoWithServers(); | ||
private DomainPresenceInfo domainPresenceInfo = createDomainPresenceInfoWithAdminServer(); | ||
private final WlsDomainConfig domainConfig = createDomainConfig(); | ||
private final Collection<ServerStartupInfo> startupInfos = new ArrayList<>(); | ||
|
||
|
@@ -108,10 +108,9 @@ private static WlsDomainConfig createDomainConfig() { | |
.withCluster(clusterConfig); | ||
} | ||
|
||
private DomainPresenceInfo createDomainPresenceInfoWithServers(String... serverNames) { | ||
private DomainPresenceInfo createDomainPresenceInfoWithAdminServer() { | ||
DomainPresenceInfo dpi = new DomainPresenceInfo(domain); | ||
addServer(dpi, ADMIN); | ||
Arrays.asList(serverNames).forEach(serverName -> addServer(dpi, serverName)); | ||
return dpi; | ||
} | ||
|
||
|
@@ -249,6 +248,23 @@ public void whenConcurrencyLimitIs1_secondClusteredServerDoesNotStartIfFirstIsNo | |
assertThat(getStartedManagedServers(), hasSize(1)); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please get in the habit of writing your unit tests before you make production code changes. It not only guides what you then implement, it also leads to writing better tests. Start with the name. It should explain what is going on, and this doesn't, as it is simply not the case that we always want to start a managed server pod when there is no admin server. The case, based on the JIRA, is that if we scale up a cluster, we will start a managed server even if the admin server is not running, and the test should reflect that. So maybe something like 'whileAdminServerStopped_canStartManagedServer' would be better. In the body of the test the first call is to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed the unit test method name and added new method |
||
@Test | ||
public void whileAdminServerStopped_canStartManagedServer() { | ||
createDomainPresenceInfoWithNoAdminServer(); | ||
addWlsCluster(CLUSTER1, MS1); | ||
|
||
invokeStepWithServerStartupInfos(); | ||
|
||
assertThat(getStartedManagedServers(), hasSize(1)); | ||
} | ||
|
||
private void createDomainPresenceInfoWithNoAdminServer() { | ||
domainPresenceInfo = new DomainPresenceInfo(domain); | ||
testSupport | ||
.addToPacket(ProcessingConstants.DOMAIN_TOPOLOGY, domainConfig) | ||
.addDomainPresenceInfo(domainPresenceInfo); | ||
} | ||
|
||
@Test | ||
public void whenConcurrencyLimitIs1_secondClusteredServerStartsAfterFirstIsReady() { | ||
configureCluster(CLUSTER1).withMaxConcurrentStartup(1); | ||
|
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.
good change. There was no need to expose the implementation as it had been.