26
26
import org .junit .jupiter .api .DisplayName ;
27
27
import org .junit .jupiter .api .Tag ;
28
28
import org .junit .jupiter .api .Test ;
29
- import org .junit .jupiter .api .condition .DisabledIfEnvironmentVariable ;
30
29
31
30
import static oracle .weblogic .kubernetes .TestConstants .COPY_WLS_LOGGING_EXPORTER_FILE_NAME ;
32
31
import static oracle .weblogic .kubernetes .TestConstants .ELASTICSEARCH_HTTPS_PORT ;
57
56
import static oracle .weblogic .kubernetes .assertions .TestAssertions .operatorIsReady ;
58
57
import static oracle .weblogic .kubernetes .utils .CommonMiiTestUtils .createMiiDomainAndVerify ;
59
58
import 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 ;
61
60
import static oracle .weblogic .kubernetes .utils .ExecCommand .exec ;
62
61
import static oracle .weblogic .kubernetes .utils .FileUtils .copyFileFromPodUsingK8sExec ;
63
62
import static oracle .weblogic .kubernetes .utils .FileUtils .searchStringInFile ;
@@ -282,7 +281,7 @@ void testLogLevelSearch() {
282
281
String queryCriteria = "/_count?q=level:INFO" ;
283
282
284
283
// verify log level query results
285
- withStandardRetryPolicy .untilAsserted (
284
+ withLongRetryPolicy .untilAsserted (
286
285
() -> assertTrue (verifyCountsHitsInSearchResults (queryCriteria , regex , LOGSTASH_INDEX_KEY , true ),
287
286
String .format ("Query logs of level=INFO failed" )));
288
287
@@ -300,9 +299,12 @@ void testOperatorLogSearch() {
300
299
String regex = ".*took\" :(\\ d+),.*hits\" :\\ {(.+)\\ }" ;
301
300
String queryCriteria = "/_search?q=type:weblogic-operator" ;
302
301
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" ));
304
306
305
- logger .info ("Query Operator log info succeeded" );
307
+ logger .info ("Query Operator log info q=type:weblogic-operator succeeded" );
306
308
}
307
309
308
310
/**
@@ -326,9 +328,9 @@ void testWebLogicLogSearch() {
326
328
* Use Elasticsearch Search APIs to query WebLogic log info pushed to Elasticsearch repository
327
329
* by WebLogic Logging Exporter. Verify that log occurrence for WebLogic servers are not empty.
328
330
*/
331
+ @ Disabled ("WlsLoggingExporter is not supported any more" )
329
332
@ Test
330
333
@ DisplayName ("Use Elasticsearch Search APIs to query WebLogic log info in WLS server pod and verify" )
331
- @ DisabledIfEnvironmentVariable (named = "OKD" , matches = "true" )
332
334
void testWlsLoggingExporter () throws Exception {
333
335
Map <String , String > wlsMap = verifyLoggingExporterReady (opNamespace , elasticSearchNs , null , WEBLOGIC_INDEX_KEY );
334
336
// merge testVarMap and wlsMap
@@ -422,7 +424,7 @@ private static void createAndVerifyDomain(String miiImage) {
422
424
423
425
private void verifyServerRunningInSearchResults (String serverName ) {
424
426
String queryCriteria = "/_search?q=log:" + serverName ;
425
- withStandardRetryPolicy .untilAsserted (
427
+ withLongRetryPolicy .untilAsserted (
426
428
() -> assertTrue (execSearchQuery (queryCriteria , LOGSTASH_INDEX_KEY ).contains ("RUNNING" ),
427
429
String .format ("serverName %s is not RUNNING" , serverName )));
428
430
@@ -531,7 +533,7 @@ private void verifyLogstashConfigMapModifyResult(String replaceStr) {
531
533
}
532
534
533
535
// wait for logstash config modified and verify
534
- withStandardRetryPolicy .untilAsserted (
536
+ withLongRetryPolicy .untilAsserted (
535
537
() -> assertTrue (copyConfigFromPodAndSearchForString (containerName , replaceStr ),
536
538
String .format ("Failed to find search string %s" , replaceStr )));
537
539
}
0 commit comments