From faff2d995a1247f717cc0a4f25627efec1b178f6 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Mon, 23 Sep 2024 16:04:17 +0300 Subject: [PATCH] Fix powerjob test when python is not available (#12315) --- .../powerjob/v4_0/PowerJobBasicProcessorTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/instrumentation/powerjob-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/powerjob/v4_0/PowerJobBasicProcessorTest.java b/instrumentation/powerjob-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/powerjob/v4_0/PowerJobBasicProcessorTest.java index f38eecfd1800..6783ee585e3c 100644 --- a/instrumentation/powerjob-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/powerjob/v4_0/PowerJobBasicProcessorTest.java +++ b/instrumentation/powerjob-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/powerjob/v4_0/PowerJobBasicProcessorTest.java @@ -207,9 +207,10 @@ void testPythonProcessor() throws Exception { trace -> { trace.hasSpansSatisfyingExactly( span -> { + // not asserting status as it is either unset or error depending on whether python + // is available or not span.hasName(String.format("%s.process", PythonProcessor.class.getSimpleName())) .hasKind(SpanKind.INTERNAL) - .hasStatus(StatusData.unset()) .hasAttributesSatisfyingExactly( attributeAssertions( PythonProcessor.class.getName(), jobId, jobParam, PYTHON_PROCESSOR)); @@ -219,7 +220,6 @@ void testPythonProcessor() throws Exception { @Test void testHttpProcessor() throws Exception { - long jobId = 1; String jobParam = "{\"method\":\"GET\"}"; TaskContext taskContext = genTaskContext(jobId, jobParam); @@ -243,7 +243,6 @@ void testHttpProcessor() throws Exception { @Test void testFileCleanerProcessor() throws Exception { - long jobId = 1; JSONObject params = new JSONObject(); params.put("dirPath", "/abc"); @@ -305,7 +304,6 @@ void testSpringDataSourceProcessor() throws Exception { @Test void testDynamicDataSourceProcessor() throws Exception { - long jobId = 1; String jobParam = "{\"dirPath\":\"/abc\"}"; TaskContext taskContext = genTaskContext(jobId, jobParam);