@@ -5,16 +5,16 @@ import datadog.trace.api.sampling.PrioritySampling
5
5
import datadog.trace.bootstrap.instrumentation.api.ScopeSource
6
6
import datadog.trace.common.writer.RemoteApi
7
7
import datadog.trace.common.writer.RemoteWriter
8
- import datadog.trace.test.util.DDSpecification
9
8
import spock.lang.Ignore
9
+ import spock.lang.Specification
10
10
import spock.lang.Subject
11
11
12
12
import java.util.concurrent.CountDownLatch
13
13
import java.util.concurrent.ThreadLocalRandom
14
14
import java.util.concurrent.TimeUnit
15
15
16
16
17
- class HealthMetricsTest extends DDSpecification {
17
+ class HealthMetricsTest extends Specification {
18
18
def statsD = Mock (StatsDClient )
19
19
20
20
@Subject
@@ -25,16 +25,14 @@ class HealthMetricsTest extends DDSpecification {
25
25
def " test onStart" () {
26
26
setup :
27
27
def writer = Mock (RemoteWriter )
28
+ def capacity = ThreadLocalRandom . current(). nextInt()
28
29
29
30
when :
30
31
healthMetrics. onStart(writer)
31
32
32
33
then :
33
34
1 * writer. getCapacity() >> capacity
34
35
0 * _
35
-
36
- where :
37
- capacity = ThreadLocalRandom . current(). nextInt()
38
36
}
39
37
40
38
def " test onShutdown" () {
@@ -150,6 +148,7 @@ class HealthMetricsTest extends DDSpecification {
150
148
setup :
151
149
def latch = new CountDownLatch (1 )
152
150
def healthMetrics = new TracerHealthMetrics (new Latched (statsD, latch), 100 , TimeUnit . MILLISECONDS )
151
+ def bytes = ThreadLocalRandom . current(). nextInt(10000 )
153
152
healthMetrics. start()
154
153
155
154
when :
@@ -162,9 +161,6 @@ class HealthMetricsTest extends DDSpecification {
162
161
163
162
cleanup :
164
163
healthMetrics. close()
165
-
166
- where :
167
- bytes = ThreadLocalRandom . current(). nextInt(10000 )
168
164
}
169
165
170
166
def " test onFailedSerialize" () {
0 commit comments