1414
1515import threading
1616import time
17+ import unittest
1718from concurrent .futures import ThreadPoolExecutor
1819from logging import WARNING , getLogger
20+ from platform import system
1921from typing import Any , Optional , Sequence
2022from unittest import TestCase
2123from 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