2626import org .junit .jupiter .api .DisplayName ;
2727import org .junit .jupiter .api .Tag ;
2828import org .junit .jupiter .api .Test ;
29- import org .junit .jupiter .api .condition .DisabledIfEnvironmentVariable ;
3029
3130import static oracle .weblogic .kubernetes .TestConstants .COPY_WLS_LOGGING_EXPORTER_FILE_NAME ;
3231import static oracle .weblogic .kubernetes .TestConstants .ELASTICSEARCH_HTTPS_PORT ;
5756import static oracle .weblogic .kubernetes .assertions .TestAssertions .operatorIsReady ;
5857import static oracle .weblogic .kubernetes .utils .CommonMiiTestUtils .createMiiDomainAndVerify ;
5958import static oracle .weblogic .kubernetes .utils .CommonTestUtils .testUntil ;
60- import static oracle .weblogic .kubernetes .utils .CommonTestUtils .withStandardRetryPolicy ;
59+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .withLongRetryPolicy ;
6160import static oracle .weblogic .kubernetes .utils .ExecCommand .exec ;
6261import static oracle .weblogic .kubernetes .utils .FileUtils .copyFileFromPodUsingK8sExec ;
6362import static oracle .weblogic .kubernetes .utils .FileUtils .searchStringInFile ;
@@ -282,7 +281,7 @@ void testLogLevelSearch() {
282281 String queryCriteria = "/_count?q=level:INFO" ;
283282
284283 // verify log level query results
285- withStandardRetryPolicy .untilAsserted (
284+ withLongRetryPolicy .untilAsserted (
286285 () -> assertTrue (verifyCountsHitsInSearchResults (queryCriteria , regex , LOGSTASH_INDEX_KEY , true ),
287286 String .format ("Query logs of level=INFO failed" )));
288287
@@ -300,9 +299,12 @@ void testOperatorLogSearch() {
300299 String regex = ".*took\" :(\\ d+),.*hits\" :\\ {(.+)\\ }" ;
301300 String queryCriteria = "/_search?q=type:weblogic-operator" ;
302301
303- verifyCountsHitsInSearchResults (queryCriteria , regex , LOGSTASH_INDEX_KEY , false );
302+ // verify results of query of type:weblogic-operator in Operator log
303+ withLongRetryPolicy .untilAsserted (
304+ () -> assertTrue (verifyCountsHitsInSearchResults (queryCriteria , regex , LOGSTASH_INDEX_KEY , false ),
305+ "Query Operator log info q=type:weblogic-operator failed" ));
304306
305- logger .info ("Query Operator log info succeeded" );
307+ logger .info ("Query Operator log info q=type:weblogic-operator succeeded" );
306308 }
307309
308310 /**
@@ -326,9 +328,9 @@ void testWebLogicLogSearch() {
326328 * Use Elasticsearch Search APIs to query WebLogic log info pushed to Elasticsearch repository
327329 * by WebLogic Logging Exporter. Verify that log occurrence for WebLogic servers are not empty.
328330 */
331+ @ Disabled ("WlsLoggingExporter is not supported any more" )
329332 @ Test
330333 @ DisplayName ("Use Elasticsearch Search APIs to query WebLogic log info in WLS server pod and verify" )
331- @ DisabledIfEnvironmentVariable (named = "OKD" , matches = "true" )
332334 void testWlsLoggingExporter () throws Exception {
333335 Map <String , String > wlsMap = verifyLoggingExporterReady (opNamespace , elasticSearchNs , null , WEBLOGIC_INDEX_KEY );
334336 // merge testVarMap and wlsMap
@@ -422,7 +424,7 @@ private static void createAndVerifyDomain(String miiImage) {
422424
423425 private void verifyServerRunningInSearchResults (String serverName ) {
424426 String queryCriteria = "/_search?q=log:" + serverName ;
425- withStandardRetryPolicy .untilAsserted (
427+ withLongRetryPolicy .untilAsserted (
426428 () -> assertTrue (execSearchQuery (queryCriteria , LOGSTASH_INDEX_KEY ).contains ("RUNNING" ),
427429 String .format ("serverName %s is not RUNNING" , serverName )));
428430
@@ -531,7 +533,7 @@ private void verifyLogstashConfigMapModifyResult(String replaceStr) {
531533 }
532534
533535 // wait for logstash config modified and verify
534- withStandardRetryPolicy .untilAsserted (
536+ withLongRetryPolicy .untilAsserted (
535537 () -> assertTrue (copyConfigFromPodAndSearchForString (containerName , replaceStr ),
536538 String .format ("Failed to find search string %s" , replaceStr )));
537539 }
0 commit comments