7
7
"fmt"
8
8
"net/http"
9
9
"net/http/httptest"
10
+ "os"
10
11
"sync"
11
12
"sync/atomic"
12
13
"testing"
@@ -50,6 +51,14 @@ func TestPartiallyFlushDelayedSpans(t *testing.T) {
50
51
51
52
generateSomeTraffic (s , maxDelayedSpans )
52
53
54
+ // serverless agent should not be present for this test to pass.
55
+ // following check is added for debugging random failures in the unit tests of delayed spans
56
+ // TODO: remove it once the issue is resolved.
57
+ _ , isURLPresent := os .LookupEnv ("INSTANA_ENDPOINT_URL" )
58
+ _ , isKeyPresent := os .LookupEnv ("INSTANA_AGENT_KEY" )
59
+ assert .Equal (t , false , isURLPresent )
60
+ assert .Equal (t , false , isKeyPresent )
61
+
53
62
assert .Len (t , delayed .spans , maxDelayedSpans )
54
63
55
64
notReadyAfter := maxDelayedSpans / 10
@@ -76,6 +85,14 @@ func TestFlushDelayedSpans(t *testing.T) {
76
85
77
86
generateSomeTraffic (s , maxDelayedSpans )
78
87
88
+ // serverless agent should not be present for this test to pass.
89
+ // following check is added for debugging random failures in the unit tests of delayed spans
90
+ // TODO: remove it once the issue is resolved.
91
+ _ , isURLPresent := os .LookupEnv ("INSTANA_ENDPOINT_URL" )
92
+ _ , isKeyPresent := os .LookupEnv ("INSTANA_AGENT_KEY" )
93
+ assert .Equal (t , false , isURLPresent )
94
+ assert .Equal (t , false , isKeyPresent )
95
+
79
96
assert .Len (t , delayed .spans , maxDelayedSpans )
80
97
81
98
sensor .agent = alwaysReadyClient {}
@@ -101,6 +118,14 @@ func TestParallelFlushDelayedSpans(t *testing.T) {
101
118
102
119
generateSomeTraffic (s , maxDelayedSpans * 2 )
103
120
121
+ // serverless agent should not be present for this test to pass.
122
+ // following check is added for debugging random failures in the unit tests of delayed spans
123
+ // TODO: remove it once the issue is resolved.
124
+ _ , isURLPresent := os .LookupEnv ("INSTANA_ENDPOINT_URL" )
125
+ _ , isKeyPresent := os .LookupEnv ("INSTANA_AGENT_KEY" )
126
+ assert .Equal (t , false , isURLPresent )
127
+ assert .Equal (t , false , isKeyPresent )
128
+
104
129
assert .Len (t , delayed .spans , maxDelayedSpans )
105
130
106
131
workers := 15
0 commit comments