Skip to content

Commit d7f07ea

Browse files
committed
tests: mark test_concurrent_writes as flaky on osx
1 parent ed3656f commit d7f07ea

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,18 @@ and compares it against the previously stored hash value.
140140

141141

142142

143-
* automatic schema inference: [1](src/cachew/tests/test_cachew.py#L385), [2](src/cachew/tests/test_cachew.py#L399)
143+
* automatic schema inference: [1](src/cachew/tests/test_cachew.py#L386), [2](src/cachew/tests/test_cachew.py#L400)
144144
* supported types:
145145

146146
* primitive: `str`, `int`, `float`, `bool`, `datetime`, `date`, `Exception`
147147

148-
See [tests.test_types](src/cachew/tests/test_cachew.py#L685), [tests.test_primitive](src/cachew/tests/test_cachew.py#L723), [tests.test_dates](src/cachew/tests/test_cachew.py#L635), [tests.test_exceptions](src/cachew/tests/test_cachew.py#L1122)
149-
* [@dataclass and NamedTuple](src/cachew/tests/test_cachew.py#L600)
150-
* [Optional](src/cachew/tests/test_cachew.py#L529) types
151-
* [Union](src/cachew/tests/test_cachew.py#L830) types
152-
* [nested datatypes](src/cachew/tests/test_cachew.py#L445)
148+
See [tests.test_types](src/cachew/tests/test_cachew.py#L686), [tests.test_primitive](src/cachew/tests/test_cachew.py#L724), [tests.test_dates](src/cachew/tests/test_cachew.py#L636), [tests.test_exceptions](src/cachew/tests/test_cachew.py#L1124)
149+
* [@dataclass and NamedTuple](src/cachew/tests/test_cachew.py#L601)
150+
* [Optional](src/cachew/tests/test_cachew.py#L530) types
151+
* [Union](src/cachew/tests/test_cachew.py#L831) types
152+
* [nested datatypes](src/cachew/tests/test_cachew.py#L446)
153153

154-
* detects [datatype schema changes](src/cachew/tests/test_cachew.py#L475) and discards old data automatically
154+
* detects [datatype schema changes](src/cachew/tests/test_cachew.py#L476) and discards old data automatically
155155

156156

157157
# Performance
@@ -170,15 +170,15 @@ You can also use [extensive unit tests](src/cachew/tests/test_cachew.py) as a re
170170

171171
Some useful (but optional) arguments of `@cachew` decorator:
172172

173-
* `cache_path` can be a directory, or a callable that [returns a path](src/cachew/tests/test_cachew.py#L422) and depends on function's arguments.
173+
* `cache_path` can be a directory, or a callable that [returns a path](src/cachew/tests/test_cachew.py#L423) and depends on function's arguments.
174174

175175
By default, `settings.DEFAULT_CACHEW_DIR` is used.
176176

177177
* `depends_on` is a function which determines whether your inputs have changed, and the cache needs to be invalidated.
178178

179179
By default it just uses string representation of the arguments, you can also specify a custom callable.
180180

181-
For instance, it can be used to [discard cache](src/cachew/tests/test_cachew.py#L119) if the input file was modified.
181+
For instance, it can be used to [discard cache](src/cachew/tests/test_cachew.py#L120) if the input file was modified.
182182

183183
* `cls` is the type that would be serialized.
184184

src/cachew/tests/test_cachew.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ruff: noqa: ARG001 # ruff thinks pytest fixtures are unused arguments
22
import hashlib
33
import inspect
4+
import platform
45
import string
56
import sys
67
import time
@@ -895,6 +896,7 @@ def fuzz_cachew_impl():
895896
# TODO how to run it enough times on CI and increase likelihood of failing?
896897
# for now, stress testing manually:
897898
# while PYTHONPATH=src pytest -s cachew -k concurrent_writes ; do sleep 0.5; done
899+
@pytest.mark.xfail(condition=platform.system() == 'Darwin', reason='seems like file writes might not be atomic on osx?')
898900
def test_concurrent_writes(tmp_path: Path, fuzz_cachew_impl) -> None:
899901
cache_path = tmp_path / 'cache.sqlite'
900902

0 commit comments

Comments
 (0)