Skip to content

Commit

Permalink
Skip thread leak checks in kafka IT
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Bharadwaj <[email protected]>
  • Loading branch information
varunbharadwaj committed Feb 5, 2025
1 parent 662fac7 commit 670e471
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.opensearch.plugin.kafka;

import com.carrotsearch.randomizedtesting.annotations.ThreadLeakAction;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;

import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
Expand Down Expand Up @@ -47,9 +47,10 @@
*/

// This test uses a Kafka test container which schedules a watcher daemon thread for monitoring hanging tests.
// The watcher thread sometimes is not stopped on time at the end of test execution resulting in the thread leak controller
// detecting leaky threads. @ThreadLeakAction is added to make this non-blocking and interrupt the leaky threads.
@ThreadLeakAction({ ThreadLeakAction.Action.WARN, ThreadLeakAction.Action.INTERRUPT })
// The watcher thread sometimes is not stopped on time at the end of test execution resulting in thread leak check
// errors after which they are attempted to be stopped. Since these threads are outside the scope of this test and have
// no good way to stop them, we disable the checks using ThreadLeakScope.Scope.NONE
@ThreadLeakScope(ThreadLeakScope.Scope.NONE)
public class IngestFromKafkaIT extends OpenSearchIntegTestCase {
static final String topicName = "test";

Expand Down

0 comments on commit 670e471

Please sign in to comment.