Skip to content

Commit

Permalink
A temporary solution to limit the number of warning messages caused b…
Browse files Browse the repository at this point in the history
…y class NodeAndClusterIdConverter during tests execution

Signed-off-by: Lukasz Soszynski <[email protected]>
  • Loading branch information
lukasz-soszynski-eliatra committed Sep 13, 2022
1 parent 08d6500 commit 67b5446
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ configurations {
sourceSets {
integrationTest {
java {
srcDir file ('src/integrationTest/java')
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
srcDir file ('src/integrationTest/java')
}
resources {
srcDir file('src/integrationTest/resources')
Expand All @@ -280,7 +280,6 @@ sourceSets {
task integrationTest(type: Test) {
description = 'Run integration tests.'
group = 'verification'
systemProperty "org.opensearch.common.logging.NodeAndClusterIdConverter.enabled", "false"
systemProperty "java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager"
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
package org.opensearch.common.logging;

/**
* Class uses to override OpenSearch NodeAndClusterIdConverter Log4j2 plugin in order to disable plugin and limit number of
* warn messages like "...ApplierService#updateTask][T#1] WARN ClusterApplierService:628 - failed to notify ClusterStateListener..."
* during tests execution.
*
* The class is rather a temporary solution and the real one should be developed in scope of:
* https://github.com/opensearch-project/OpenSearch/pull/4322
*/
import org.apache.logging.log4j.core.LogEvent;

class NodeAndClusterIdConverter {


public NodeAndClusterIdConverter() {
}

public static void setNodeIdAndClusterId(String nodeId, String clusterUUID) {
}

public void format(LogEvent event, StringBuilder toAppendTo) {
}
}

0 comments on commit 67b5446

Please sign in to comment.