105105import org .jetbrains .annotations .NotNull ;
106106import org .junit .jupiter .api .AfterEach ;
107107import org .junit .jupiter .api .BeforeEach ;
108- import org .junit .jupiter .api .Disabled ;
109108import org .junit .jupiter .api .Test ;
110109
111110import static com .meterware .simplestub .Stub .createStub ;
144143import static oracle .kubernetes .operator .ProcessingConstants .DOMAIN_INTROSPECTOR_JOB ;
145144import static oracle .kubernetes .operator .WebLogicConstants .RUNNING_STATE ;
146145import static oracle .kubernetes .operator .WebLogicConstants .SHUTDOWN_STATE ;
147- import static oracle .kubernetes .operator .WebLogicConstants .SUSPENDING_STATE ;
148146import static oracle .kubernetes .operator .WebLogicConstants .UNKNOWN_STATE ;
149147import static oracle .kubernetes .operator .helpers .AffinityHelper .getDefaultAntiAffinity ;
150148import static oracle .kubernetes .operator .helpers .EventHelper .EventItem .CLUSTER_CHANGED ;
168166import static oracle .kubernetes .operator .helpers .StepContextConstants .FLUENTD_CONFIG_DATA_NAME ;
169167import static oracle .kubernetes .operator .http .client .HttpAsyncTestSupport .OK_RESPONSE ;
170168import static oracle .kubernetes .operator .http .client .HttpAsyncTestSupport .createExpectedRequest ;
171- import static oracle .kubernetes .operator .tuning .TuningParameters .INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS ;
172169import static oracle .kubernetes .weblogic .domain .model .DomainConditionMatcher .hasCondition ;
173170import static oracle .kubernetes .weblogic .domain .model .DomainConditionType .AVAILABLE ;
174171import static oracle .kubernetes .weblogic .domain .model .DomainConditionType .COMPLETED ;
@@ -720,31 +717,6 @@ void afterMakeRightAndChangeServerToNever_stateGoalIsShutdown() {
720717 assertThat (getResourceVersion (updatedDomain ), not (getResourceVersion (domain )));
721718 }
722719
723- @ Test
724- @ Disabled ("Test attempts to shut down a running server instance using REST" )
725- void afterMakeRightAndChangeServerToNever_serverPodsWaitForShutdownWithHttpToCompleteBeforeTerminating () {
726- domainConfigurator .configureCluster (newInfo , CLUSTER ).withReplicas (MIN_REPLICAS );
727- newInfo .getReferencedClusters ().forEach (testSupport ::defineResources );
728-
729- processor .createMakeRightOperation (newInfo ).execute ();
730-
731- domainConfigurator .withDefaultServerStartPolicy (ServerStartPolicy .NEVER );
732- DomainStatus status = newInfo .getDomain ().getStatus ();
733- defineServerShutdownWithHttpOkResponse ();
734- setAdminServerStatus (status , SUSPENDING_STATE );
735- setManagedServerState (status , SUSPENDING_STATE );
736-
737- processor .createMakeRightOperation (newInfo ).withExplicitRecheck ().execute ();
738- DomainResource updatedDomain = testSupport .getResourceWithName (DOMAIN , UID );
739-
740- assertThat (getRunningPods ().size (), equalTo (4 ));
741- setAdminServerStatus (status , SHUTDOWN_STATE );
742- setManagedServerState (status , SHUTDOWN_STATE );
743- testSupport .setTime (100 , TimeUnit .SECONDS );
744- assertThat (getRunningPods ().size (), equalTo (1 ));
745- assertThat (getResourceVersion (updatedDomain ), not (getResourceVersion (domain )));
746- }
747-
748720 private void defineServerShutdownWithHttpOkResponse () {
749721 httpSupport .defineResponse (createShutdownRequest (ADMIN_NAME , 7001 ),
750722 createStub (HttpResponseStub .class , HTTP_OK , OK_RESPONSE ));
@@ -1781,18 +1753,6 @@ private void assignUid(V1Job job) {
17811753 Optional .ofNullable (job ).map (V1Job ::getMetadata ).ifPresent (m -> m .setUid (Long .toString (++uidNum )));
17821754 }
17831755
1784- @ Test
1785- @ Disabled ("Test attempts to check health of running server instance" )
1786- void whenIntrospectionJobTimedOut_activeDeadlineIncreased () throws Exception {
1787- TuningParametersStub .setParameter (INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS , "180" );
1788-
1789- runMakeRight_withIntrospectionTimeout ();
1790-
1791- executeScheduledRetry ();
1792-
1793- assertThat (getRecordedJob ().getSpec ().getActiveDeadlineSeconds (), is (240L ));
1794- }
1795-
17961756 private V1Job getRecordedJob () {
17971757 return testSupport .<V1Job >getResources (JOB ).get (0 );
17981758 }
@@ -1801,18 +1761,6 @@ private void executeScheduledRetry() {
18011761 testSupport .setTime (domain .getFailureRetryIntervalSeconds (), TimeUnit .SECONDS );
18021762 }
18031763
1804- @ Test
1805- @ Disabled ("Test attempts to check health of running server instance" )
1806- void whenIntrospectionJobTimedOutForInitDomainOnPV_activeDeadlineNotIncreased () throws Exception {
1807- TuningParametersStub .setParameter (INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS , "180" );
1808- initializeDomainOnPV ();
1809- runMakeRight_withIntrospectionTimeout ();
1810-
1811- executeScheduledRetry ();
1812-
1813- assertThat (getRecordedJob ().getSpec ().getActiveDeadlineSeconds (), is (180L ));
1814- }
1815-
18161764 private void initializeDomainOnPV () {
18171765 domainConfigurator .withConfigurationForInitializeDomainOnPV (
18181766 new InitializeDomainOnPV (), "test-volume" , "test-pvc" , "/shared" );
@@ -2077,29 +2025,6 @@ private String defineTopology(List<String> clusterNames, List<String> serverName
20772025 return IntrospectionTestUtils .createTopologyYaml (createDomainConfig (clusterNames , serverNames ));
20782026 }
20792027
2080- @ Test
2081- @ Disabled ("Needs update for change in behavior to list job pods" )
2082- void whenIntrospectionJobInitContainerScriptExecError_domainStatusUpdated () throws Exception {
2083- consoleHandlerMemento .ignoringLoggedExceptions (RuntimeException .class );
2084- consoleHandlerMemento .ignoreMessage (MessageKeys .NOT_STARTING_DOMAINUID_THREAD );
2085- jobStatusSupplier .setJobStatus (createBackoffStatus ());
2086-
2087- establishPreviousIntrospection (null );
2088- defineIntrospectionWithInitContainerWithExecFormatError ();
2089- testSupport .doOnDelete (JOB , j -> deletePod ());
2090- testSupport .doOnCreate (JOB , j -> createJobPodAndSetExecFormatErrorStatus (job ));
2091- testSupport .definePodLog (LegalNames .toJobIntrospectorName (UID ), NS ,
2092- String .format (EXEC_FORMAT_ERROR , defineTopology ()));
2093- domainConfigurator .withIntrospectVersion (NEW_INTROSPECTION_STATE );
2094- newInfo .getReferencedClusters ().forEach (testSupport ::defineResources );
2095-
2096- processor .createMakeRightOperation (newInfo ).interrupt ().execute ();
2097-
2098- assertThat (newDomain .getStatus ().getMessage ().contains (EXEC_FORMAT_ERROR ), is (true ));
2099- }
2100-
2101- // case 1: job was able to pull, time out during introspection: pod will have DEADLINE_EXCEEDED
2102-
21032028 @ Test
21042029 void afterIntrospection_introspectorConfigMapHasUpToDateLabel () throws Exception {
21052030 establishPreviousIntrospection (null );
@@ -2905,23 +2830,6 @@ private void defineDuplicateServerNames() {
29052830 newDomain .getSpec ().getManagedServers ().add (new ManagedServer ().withServerName ("ms1" ));
29062831 }
29072832
2908- @ Test
2909- @ Disabled ("Test attempts to check health of running server instance" )
2910- void whenWebLogicCredentialsSecretRemoved_NullPointerExceptionAndAbortedEventNotGenerated () {
2911- consoleHandlerMemento .ignoreMessage (NOT_STARTING_DOMAINUID_THREAD );
2912- processor .registerDomainPresenceInfo (originalInfo );
2913- domain .getSpec ().withWebLogicCredentialsSecret (null );
2914- long time = 0 ;
2915-
2916- for (int numRetries = 0 ; numRetries < 5 ; numRetries ++) {
2917- processor .createMakeRightOperation (originalInfo ).withExplicitRecheck ().execute ();
2918- time += domain .getFailureRetryIntervalSeconds ();
2919- testSupport .setTime (time , TimeUnit .SECONDS );
2920- }
2921-
2922- assertThat (getEvents ().stream ().anyMatch (EventTestUtils ::isDomainFailedAbortedEvent ), is (false ));
2923- }
2924-
29252833 private List <CoreV1Event > getEvents () {
29262834 return testSupport .getResources (KubernetesTestSupport .EVENT );
29272835 }
@@ -2969,18 +2877,6 @@ private void addClustersAndDispatchClusterWatch() {
29692877 processor .dispatchClusterWatch (item );
29702878 }
29712879
2972- @ Test
2973- @ Disabled
2974- void whenDomainAndClusterResourcesAddedAtSameTime_introspectorJobHasCorrectOwnerReference () {
2975- consoleHandlerMemento .ignoringLoggedExceptions (ApiException .class );
2976- domain .getOrCreateStatus ().addCondition (new DomainCondition (AVAILABLE ).withStatus (false ));
2977- setupNewDomainResource (NEW_DOMAIN_UID );
2978- processor .registerDomainPresenceInfo (originalInfo );
2979- addClustersAndDispatchClusterWatch ();
2980-
2981- assertThat (getIntrospectorJobOwnerReferenceUid (), equalTo (NEW_DOMAIN_UID ));
2982- }
2983-
29842880 private void setupNewDomainResource (String newUid ) {
29852881 testSupport .deleteResources (domain );
29862882 testSupport .defineResources (newDomain .withMetadata (newDomain .getMetadata ().uid (newUid )));
0 commit comments