Skip to content

Commit

Permalink
Fix TracingSegmentRunner (testing only) (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeCqupt authored May 12, 2024
1 parent 7dd7914 commit 0bf535e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected Object createTest() throws Exception {

@Override
protected Statement withAfters(FrameworkMethod method, Object target, final Statement statement) {
return new Statement() {
Statement st = new Statement() {
@Override
public void evaluate() throws Throwable {
if (field != null) {
Expand Down Expand Up @@ -89,5 +89,7 @@ public void afterFinished(IgnoredTracerContext tracerContext) {
}
}
};

return super.withAfters(method, target, st);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected Object createTest() throws Exception {

@Override
protected Statement withAfters(FrameworkMethod method, Object target, final Statement statement) {
return new Statement() {
Statement st = new Statement() {
@Override
public void evaluate() throws Throwable {
if (field != null) {
Expand Down Expand Up @@ -89,5 +89,7 @@ public void afterFinished(IgnoredTracerContext tracerContext) {
}
}
};

return super.withAfters(method, target, st);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ public void clear() {
@AfterClass
public static void clearAfterAll() {
// test from threadlocalaccessor test x 2 TODO: I have no idea what is going on
ContextManager.stopSpan();
ContextManager.stopSpan();
assertThat(ContextManager.isActive(), is(false));
}

Expand All @@ -103,13 +101,15 @@ public void testServiceFromPlugin() {
PluginBootService.class);

Assert.assertNotNull(service);
ContextManager.stopSpan();
}

@Test
public void testServiceOverrideFromPlugin() {
ContextManagerExtendService service = ServiceManager.INSTANCE.findService(ContextManagerExtendService.class);

Assert.assertTrue(service instanceof ContextManagerExtendOverrideService);
ContextManager.stopSpan();
}

@Test
Expand Down

0 comments on commit 0bf535e

Please sign in to comment.