janhoy commented on code in PR #1168: URL: https://github.com/apache/solr/pull/1168#discussion_r1060199981
########## solr/modules/opentelemetry/src/test/org/apache/solr/opentelemetry/OtelTracerConfiguratorTest.java: ########## @@ -73,4 +86,24 @@ public void testSetDefaultIfNotConfigured() { assertEquals("default", instance.getCurrentOtelConfig().get("OTEL_YEY")); assertEquals("prop-k1", instance.getCurrentOtelConfig().get("OTEL_K1")); } + + @Test + public void testInjected() throws Exception { + // Make sure the batch exporter times out before our thread lingering time of 10s + instance.setDefaultIfNotConfigured("OTEL_BSP_SCHEDULE_DELAY", "1000"); + instance.setDefaultIfNotConfigured("OTEL_BSP_EXPORT_TIMEOUT", "2000"); + MiniSolrCloudCluster cluster = + new MiniSolrCloudCluster.Builder(2, createTempDir()) + .addConfig("config", TEST_PATH().resolve("collection1").resolve("conf")) + .withSolrXml(getFile("solr/solr.xml").toPath()) + .build(); + try { + TimeOut timeOut = new TimeOut(2, TimeUnit.MINUTES, TimeSource.NANO_TIME); + timeOut.waitFor( + "Waiting for GlobalTracer is registered", + () -> GlobalTracer.get().toString().contains("TracerShim")); Review Comment: What's surprising? That we need to wait for the global tracer to be registered? Guess we're waiting for the `MiniSolrCloudCluster` to bootstrap, which will eventually lead to CoreContainer registering the tracer. This test was copied from Jaeger module. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org