Skip to content

Commit ec69083

Browse files
committed
Skip some tests on windows
1 parent 267b9a9 commit ec69083

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import threading
1616
import time
17+
import unittest
1718
from concurrent.futures import ThreadPoolExecutor
1819
from logging import WARNING, getLogger
20+
from platform import system
1921
from typing import Any, Optional, Sequence
2022
from unittest import TestCase
2123
from unittest.mock import Mock, patch
@@ -369,6 +371,7 @@ def test_export_over_closed_grpc_channel(self):
369371
str(err.exception), "Cannot invoke RPC on closed channel!"
370372
)
371373

374+
@unittest.skipIf(system() == "Windows", "Does not work in Windows")
372375
def test_retry_info_is_respected(self):
373376
mock_trace_service = TraceServiceServicerWithExportParams(
374377
StatusCode.UNAVAILABLE,
@@ -389,6 +392,7 @@ def test_retry_info_is_respected(self):
389392
# 1 second plus wiggle room so the test passes consistently.
390393
self.assertAlmostEqual(after - before, 1, 1)
391394

395+
@unittest.skipIf(system() == "Windows", "Does not work in Windows")
392396
def test_retry_not_made_if_would_exceed_timeout(self):
393397
mock_trace_service = TraceServiceServicerWithExportParams(
394398
StatusCode.UNAVAILABLE
@@ -410,6 +414,7 @@ def test_retry_not_made_if_would_exceed_timeout(self):
410414
# There's a +/-20% jitter on each backoff.
411415
self.assertTrue(2.35 < after - before < 3.65)
412416

417+
@unittest.skipIf(system() == "Windows", "Does not work in Windows")
413418
def test_timeout_set_correctly(self):
414419
mock_trace_service = TraceServiceServicerWithExportParams(
415420
StatusCode.UNAVAILABLE, optional_export_sleep=0.25
@@ -431,6 +436,10 @@ def test_timeout_set_correctly(self):
431436
SpanExportResult.FAILURE,
432437
)
433438
after = time.time()
439+
self.assertEqual(
440+
"Failed to export traces to localhost:4317, error code: StatusCode.DEADLINE_EXCEEDED",
441+
warning.records[-1].message,
442+
)
434443
self.assertEqual(mock_trace_service.num_requests, 2)
435444
self.assertAlmostEqual(after - before, 1.4, 1)
436445

0 commit comments

Comments
 (0)