@@ -10,7 +10,6 @@ import (
10
10
"testing"
11
11
"time"
12
12
13
- "github.com/juju/errors"
14
13
"github.com/signalfx/golib/v3/datapoint"
15
14
"github.com/signalfx/golib/v3/event"
16
15
"github.com/signalfx/golib/v3/log"
@@ -41,9 +40,9 @@ func TestAddDataToAsyncMultitokenSink(t *testing.T) {
41
40
spans := GoSpanSource .Spans ()
42
41
43
42
Convey ("shouldn't accept dps and events with a context if a token isn't provided in the context" , func () {
44
- So (errors . Details ( s .AddEvents (ctx , evs )), ShouldContainSubstring , "no value was found on the context with key" )
45
- So (errors . Details ( s .AddDatapoints (ctx , dps )), ShouldContainSubstring , "no value was found on the context with key" )
46
- So (errors . Details ( s .AddSpans (ctx , spans )), ShouldContainSubstring , "no value was found on the context with key" )
43
+ So (s .AddEvents (ctx , evs ). Error ( ), ShouldContainSubstring , "no value was found on the context with key" )
44
+ So (s .AddDatapoints (ctx , dps ). Error ( ), ShouldContainSubstring , "no value was found on the context with key" )
45
+ So (s .AddSpans (ctx , spans ). Error ( ), ShouldContainSubstring , "no value was found on the context with key" )
47
46
})
48
47
49
48
Convey ("shouldn't accept dps and events if the sink has started, but the workers have shutdown" , func () {
@@ -52,10 +51,10 @@ func TestAddDataToAsyncMultitokenSink(t *testing.T) {
52
51
So (s .Close (), ShouldBeNil )
53
52
_ = s .AddEvents (ctx , evs )
54
53
_ = s .AddDatapointsWithToken ("HELLOOOOOO" , dps )
55
- So (errors . Details ( s .AddEvents (ctx , evs )), ShouldContainSubstring , "unable to add events: the worker has been stopped" )
56
- So (errors . Details ( s .AddDatapoints (ctx , dps )), ShouldContainSubstring , "unable to add datapoints: the worker has been stopped" )
57
- So (errors . Details ( s .AddEventsWithToken ("HELLOOOOO" , evs )), ShouldContainSubstring , "unable to add events: the worker has been stopped" )
58
- So (errors . Details ( s .AddDatapointsWithToken ("HELLOOOOOO" , dps )), ShouldContainSubstring , "unable to add datapoints: the worker has been stopped" )
54
+ So (s .AddEvents (ctx , evs ). Error ( ), ShouldContainSubstring , "unable to add events: the worker has been stopped" )
55
+ So (s .AddDatapoints (ctx , dps ). Error ( ), ShouldContainSubstring , "unable to add datapoints: the worker has been stopped" )
56
+ So (s .AddEventsWithToken ("HELLOOOOO" , evs ). Error ( ), ShouldContainSubstring , "unable to add events: the worker has been stopped" )
57
+ So (s .AddDatapointsWithToken ("HELLOOOOOO" , dps ). Error ( ), ShouldContainSubstring , "unable to add datapoints: the worker has been stopped" )
59
58
})
60
59
})
61
60
}
@@ -282,7 +281,7 @@ func TestAsyncMultiTokenSinkShutdownDroppedDatapoints(t *testing.T) {
282
281
for atomic .LoadInt64 (& s .dpBuffered ) <= int64 (iterations ) {
283
282
runtime .Gosched ()
284
283
}
285
- So (errors . Details ( s .Close ()), ShouldContainSubstring , "may have been dropped" )
284
+ So (s .Close (). Error ( ), ShouldContainSubstring , "may have been dropped" )
286
285
})
287
286
})
288
287
}
@@ -313,7 +312,7 @@ func TestAsyncMultiTokenSinkShutdownDroppedEvents(t *testing.T) {
313
312
for atomic .LoadInt64 (& s .evBuffered ) <= int64 (iterations ) {
314
313
runtime .Gosched ()
315
314
}
316
- So (errors . Details ( s .Close ()), ShouldContainSubstring , "may have been dropped" )
315
+ So (s .Close (). Error ( ), ShouldContainSubstring , "may have been dropped" )
317
316
})
318
317
})
319
318
}
@@ -344,7 +343,7 @@ func TestAsyncMultiTokenSinkShutdownDroppedSpans(t *testing.T) {
344
343
for atomic .LoadInt64 (& s .spansBuffered ) <= int64 (iterations ) {
345
344
runtime .Gosched ()
346
345
}
347
- So (errors . Details ( s .Close ()), ShouldContainSubstring , "may have been dropped" )
346
+ So (s .Close (). Error ( ), ShouldContainSubstring , "may have been dropped" )
348
347
})
349
348
})
350
349
}
0 commit comments