Skip to content

Commit 90d79ae

Browse files
committed
Fix failing urllib test case
This test case started failing after a fix for the handling of empty metric collection cycles was added to the core repo. Fixes #2032
1 parent 657d502 commit 90d79ae

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'release/*'
77
pull_request:
88
env:
9-
CORE_REPO_SHA: 0ef76a5cc39626f783416ca75e43556e2bb2739d
9+
CORE_REPO_SHA: d054dff47d2da663a39b9656d106c3d15f344269
1010

1111
jobs:
1212
build:

instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,18 @@ def test_metric_uninstrument(self):
190190
metrics = self.get_sorted_metrics()
191191
self.assertEqual(len(metrics), 3)
192192

193+
self.assertEqual(
194+
metrics[0].data.data_points[0].sum, 1
195+
)
196+
self.assertEqual(
197+
metrics[1].data.data_points[0].sum, 0
198+
)
199+
self.assertEqual(
200+
metrics[2].data.data_points[0].sum, 6
201+
)
202+
193203
URLLibInstrumentor().uninstrument()
194204
with request.urlopen(self.URL):
195-
metrics = self.get_sorted_metrics()
196-
self.assertEqual(len(metrics), 3)
197-
198-
for metric in metrics:
199-
for point in list(metric.data.data_points):
200-
self.assertEqual(point.count, 1)
205+
self.assertIsNone(
206+
self.memory_metrics_reader.get_metrics_data()
207+
)

0 commit comments

Comments
 (0)