Skip to content

Commit

Permalink
Remove type weirdness from refactor in test
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbenson committed May 18, 2020
1 parent 9ec7a22 commit 6b09fc4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ class ScopeManagerTest extends DDSpecification {

def "scopemanager returns noop scope if depth exceeded"() {
when: "fill up the scope stack"
AgentScope scope = null
ContinuableScopeManager.ContinuableScope scope = null
for (int i = 0; i <= depth; i++) {
def span = tracer.buildSpan("test").start()
scope = tracer.activateSpan(span)
assert scope instanceof ScopeInterceptor.Scope
assert scope instanceof ContinuableScopeManager.ContinuableScope
}

then: "last scope is still valid"
(scope as ScopeInterceptor.Scope).depth() == depth
scope.depth() == depth

when: "activate a scope over the limit"
scope = scopeManager.activate(NoopAgentSpan.INSTANCE)
Expand All @@ -157,7 +157,7 @@ class ScopeManagerTest extends DDSpecification {
scope instanceof NoopAgentScope

and: "scope stack not effected."
(scopeManager.active() as ScopeInterceptor.Scope).depth() == depth
(scopeManager.active() as ContinuableScopeManager.ContinuableScope).depth() == depth

where:
depth = scopeManager.depthLimit
Expand Down Expand Up @@ -200,7 +200,7 @@ class ScopeManagerTest extends DDSpecification {
def "test continuation doesn't have hard reference on scope"() {
setup:
def span = tracer.buildSpan("test").start()
def scopeRef = new AtomicReference<ScopeInterceptor.Scope>(tracer.activateSpan(span) as ScopeInterceptor.Scope)
def scopeRef = new AtomicReference<AgentScope>(tracer.activateSpan(span))
scopeRef.get().setAsyncPropagation(true)
def continuation = scopeRef.get().capture()
scopeRef.get().close()
Expand Down

0 comments on commit 6b09fc4

Please sign in to comment.