forked from p15670423/monkey
Tests: Skip batching telemetry tests on Windows
The batching telemetry tests do not function properly on Windows. They sometimes pass and sometimes fail due to a race condition. I've been unable to get this race condition to manifest on Linux and I believe this is likely due to differences in how threads and the GIL are handled between the two operating systems.
This commit is contained in:
parent
4affb11128
commit
320d7b48d0
|
@ -1,5 +1,8 @@
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from infection_monkey.telemetry.base_telem import BaseTelem
|
from infection_monkey.telemetry.base_telem import BaseTelem
|
||||||
from infection_monkey.telemetry.batchable_telem_mixin import BatchableTelemMixin
|
from infection_monkey.telemetry.batchable_telem_mixin import BatchableTelemMixin
|
||||||
from infection_monkey.telemetry.i_batchable_telem import IBatchableTelem
|
from infection_monkey.telemetry.i_batchable_telem import IBatchableTelem
|
||||||
|
@ -60,6 +63,7 @@ def build_batching_telemetry_messenger(monkeypatch, telemetry_messenger_spy):
|
||||||
return BatchingTelemetryMessenger(telemetry_messenger_spy, period=PERIOD)
|
return BatchingTelemetryMessenger(telemetry_messenger_spy, period=PERIOD)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.name != "posix", reason="This test is racey on Windows")
|
||||||
def test_send_immediately(monkeypatch, telemetry_messenger_spy):
|
def test_send_immediately(monkeypatch, telemetry_messenger_spy):
|
||||||
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
||||||
monkeypatch, telemetry_messenger_spy
|
monkeypatch, telemetry_messenger_spy
|
||||||
|
@ -76,6 +80,7 @@ def test_send_immediately(monkeypatch, telemetry_messenger_spy):
|
||||||
del batching_telemetry_messenger
|
del batching_telemetry_messenger
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.name != "posix", reason="This test is racey on Windows")
|
||||||
def test_send_telem_batch(monkeypatch, telemetry_messenger_spy):
|
def test_send_telem_batch(monkeypatch, telemetry_messenger_spy):
|
||||||
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
||||||
monkeypatch, telemetry_messenger_spy
|
monkeypatch, telemetry_messenger_spy
|
||||||
|
@ -100,6 +105,7 @@ def test_send_telem_batch(monkeypatch, telemetry_messenger_spy):
|
||||||
del batching_telemetry_messenger
|
del batching_telemetry_messenger
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.name != "posix", reason="This test is racey on Windows")
|
||||||
def test_send_different_telem_types(monkeypatch, telemetry_messenger_spy):
|
def test_send_different_telem_types(monkeypatch, telemetry_messenger_spy):
|
||||||
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
||||||
monkeypatch, telemetry_messenger_spy
|
monkeypatch, telemetry_messenger_spy
|
||||||
|
@ -124,6 +130,7 @@ def test_send_different_telem_types(monkeypatch, telemetry_messenger_spy):
|
||||||
del batching_telemetry_messenger
|
del batching_telemetry_messenger
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.name != "posix", reason="This test is racey on Windows")
|
||||||
def test_send_two_batches(monkeypatch, telemetry_messenger_spy):
|
def test_send_two_batches(monkeypatch, telemetry_messenger_spy):
|
||||||
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
||||||
monkeypatch, telemetry_messenger_spy
|
monkeypatch, telemetry_messenger_spy
|
||||||
|
@ -150,6 +157,7 @@ def test_send_two_batches(monkeypatch, telemetry_messenger_spy):
|
||||||
del batching_telemetry_messenger
|
del batching_telemetry_messenger
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.name != "posix", reason="This test is racey on Windows")
|
||||||
def test_send_remaining_telem_after_stop(monkeypatch, telemetry_messenger_spy):
|
def test_send_remaining_telem_after_stop(monkeypatch, telemetry_messenger_spy):
|
||||||
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
batching_telemetry_messenger = build_batching_telemetry_messenger(
|
||||||
monkeypatch, telemetry_messenger_spy
|
monkeypatch, telemetry_messenger_spy
|
||||||
|
|
Loading…
Reference in New Issue