From 727f1fdfea14271a61c04dade8c4239e6042b41f Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 2 Feb 2022 14:11:32 -0800 Subject: [PATCH 1/2] TST: Skip flaky, crashing test in Windows --- pandas/tests/test_sorting.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/tests/test_sorting.py b/pandas/tests/test_sorting.py index d32c72b3df974..798e4d0d49064 100644 --- a/pandas/tests/test_sorting.py +++ b/pandas/tests/test_sorting.py @@ -5,6 +5,8 @@ import numpy as np import pytest +from pandas.compat import is_platform_windows + from pandas import ( DataFrame, MultiIndex, @@ -424,6 +426,11 @@ def test_codes(self, verify, codes, exp_codes, na_sentinel): tm.assert_numpy_array_equal(result, expected) tm.assert_numpy_array_equal(result_codes, expected_codes) + @pytest.mark.skipif( + is_platform_windows(), + reason="In CI environment can crash thread with: " + "Windows fatal exception: access violation", + ) @pytest.mark.parametrize("na_sentinel", [-1, 99]) def test_codes_out_of_bound(self, na_sentinel): values = [3, 1, 2, 0, 4] From f19cce187ca6f376b22df96ea162b8ae814ffc92 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Thu, 3 Feb 2022 09:35:48 -0800 Subject: [PATCH 2/2] Add CI check --- pandas/tests/test_sorting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/tests/test_sorting.py b/pandas/tests/test_sorting.py index 798e4d0d49064..374944a4e17c9 100644 --- a/pandas/tests/test_sorting.py +++ b/pandas/tests/test_sorting.py @@ -1,6 +1,7 @@ from collections import defaultdict from datetime import datetime from itertools import product +import os import numpy as np import pytest @@ -427,7 +428,7 @@ def test_codes(self, verify, codes, exp_codes, na_sentinel): tm.assert_numpy_array_equal(result_codes, expected_codes) @pytest.mark.skipif( - is_platform_windows(), + is_platform_windows() and os.environ.get("PANDAS_CI", "0") == "1", reason="In CI environment can crash thread with: " "Windows fatal exception: access violation", )