You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2021/01/14 11:39:30 UTC

[shardingsphere] branch master updated: fix test bug (#9031)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ac3fc8  fix test bug (#9031)
0ac3fc8 is described below

commit 0ac3fc81e47f53a82c1f4588ea4327d3f7638402
Author: xiaoyu <54...@qq.com>
AuthorDate: Thu Jan 14 19:39:02 2021 +0800

    fix test bug (#9031)
---
 .../tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java
index dce603d..07cf666 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java
@@ -17,8 +17,11 @@
 
 package org.apache.shardingsphere.agent.plugin.tracing.jaeger.service;
 
+import io.opentracing.noop.NoopTracerFactory;
 import io.opentracing.util.GlobalTracer;
+import java.lang.reflect.Field;
 import java.util.Properties;
+import lombok.SneakyThrows;
 import org.apache.shardingsphere.agent.config.PluginConfiguration;
 import org.junit.After;
 import org.junit.Test;
@@ -47,8 +50,12 @@ public final class JaegerTracingPluginBootServiceTest {
         assertThat(jaegerTracingPluginBootService.getType(), is("Jaeger"));
     }
     
+    @SneakyThrows
     @After
     public void close() {
         jaegerTracingPluginBootService.close();
+        Field field = GlobalTracer.class.getDeclaredField("tracer");
+        field.setAccessible(true);
+        field.set(null, NoopTracerFactory.create());
     }
 }