Skip to content

Commit e7eab03

Browse files
committed
fix some tests
1 parent 7812f13 commit e7eab03

File tree

5 files changed

+9
-8
lines changed
  • dev-packages
    • cloudflare-integration-tests/suites/public-api/startSpan-streamed
    • e2e-tests/test-applications/nextjs-16/tests
    • node-integration-tests/suites/tracing

5 files changed

+9
-8
lines changed

dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ it('sends a streamed span envelope with correct spans for a manually started spa
221221
},
222222
'http.request.header.cf_connecting_ip': {
223223
type: 'string',
224-
value: '::1',
224+
value: expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
225225
},
226226
'http.request.header.host': {
227227
type: 'string',

dev-packages/e2e-tests/test-applications/nextjs-16/tests/middleware.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
104104
'http.request.method': 'GET',
105105
'http.request.method_original': 'GET',
106106
'http.response.status_code': 200,
107-
'network.peer.address': '::1',
107+
// localhost resolves to IPv4 or IPv6 depending on OS / container
108+
'network.peer.address': expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
108109
'network.peer.port': 3030,
109110
'otel.kind': 'CLIENT',
110111
'sentry.op': 'http.client',

dev-packages/node-integration-tests/suites/tracing/http-client-spans/fetch-strip-query/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test('strips and handles query params in spans of outgoing fetch requests', asyn
2929
'http.request.method': 'GET',
3030
'http.request.method_original': 'GET',
3131
'http.response.status_code': 200,
32-
'network.peer.address': '::1',
32+
'network.peer.address': expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
3333
'network.peer.port': expect.any(Number),
3434
'otel.kind': 'CLIENT',
3535
'server.port': expect.any(Number),

dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('strips and handles query params in spans of outgoing http requests', async
3131
'http.response_content_length_uncompressed': 0,
3232
'http.status_code': 200,
3333
'http.status_text': 'OK',
34-
'net.peer.ip': '::1',
34+
'net.peer.ip': expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
3535
'net.peer.name': 'localhost',
3636
'net.peer.port': expect.any(Number),
3737
'net.transport': 'ip_tcp',

dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ describe('httpIntegration', () => {
118118
'http.target': '/test?a=1&b=2',
119119
'http.url': `http://localhost:${port}/test?a=1&b=2`,
120120
'http.user_agent': 'node',
121-
'net.host.ip': '::1',
121+
'net.host.ip': expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
122122
'net.host.name': 'localhost',
123123
'net.host.port': port,
124-
'net.peer.ip': '::1',
124+
'net.peer.ip': expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
125125
'net.peer.port': expect.any(Number),
126126
'net.transport': 'ip_tcp',
127127
'otel.kind': 'SERVER',
@@ -160,10 +160,10 @@ describe('httpIntegration', () => {
160160
'http.target': '/test?a=1&b=2',
161161
'http.url': `http://localhost:${port}/test?a=1&b=2`,
162162
'http.user_agent': 'node',
163-
'net.host.ip': '::1',
163+
'net.host.ip': expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
164164
'net.host.name': 'localhost',
165165
'net.host.port': port,
166-
'net.peer.ip': '::1',
166+
'net.peer.ip': expect.stringMatching(/^(127\.0\.0\.1|::1)$/),
167167
'net.peer.port': expect.any(Number),
168168
'net.transport': 'ip_tcp',
169169
'otel.kind': 'SERVER',

0 commit comments

Comments
 (0)