Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@
*/
public class DataFusionNativeBridgeTests extends OpenSearchTestCase {

// Note: initTokioRuntimeManager uses OnceLock and can only be initialized once per JVM.
// Do NOT call shutdownTokioRuntimeManager() here — it permanently kills the shared
// executor and other test classes (DatafusionSearchExecEngineTests, etc.) will fail
// with "Worker gone" if they run after this class.

public void testRuntimeLifecycle() {
// Init tokio runtime
// Init tokio runtime (no-op if already initialized by another test class)
NativeBridge.initTokioRuntimeManager(2);

// Create global runtime with small memory pool
Expand All @@ -35,9 +40,8 @@ public void testRuntimeLifecycle() {
);
assertTrue("Runtime pointer should be non-zero", runtimePtr != 0);

// Clean up
// Clean up the per-test runtime only
NativeBridge.closeGlobalRuntime(runtimePtr);
NativeBridge.shutdownTokioRuntimeManager();
}

public void testReaderLifecycle() throws Exception {
Expand All @@ -58,6 +62,5 @@ public void testReaderLifecycle() throws Exception {
readerHandle.close();

NativeBridge.closeGlobalRuntime(runtimePtr);
NativeBridge.shutdownTokioRuntimeManager();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.opensearch.be.datafusion;

import org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix;
import org.opensearch.analytics.backend.EngineResultBatch;
import org.opensearch.analytics.backend.EngineResultStream;
import org.opensearch.be.datafusion.nativelib.NativeBridge;
Expand All @@ -26,7 +25,6 @@
* DatafusionReader → DatafusionContext → DatafusionSearchExecEngine → EngineResultStream → EngineResultBatch.
* Uses sqlToSubstrait to generate plan bytes, then exercises the real plugin classes.
*/
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/21195")
public class DatafusionSearchExecEngineTests extends OpenSearchTestCase {

private ReaderHandle readerHandle;
Expand Down
Loading