Changelog updated to document PR #10641

This commit is contained in:
Saravanan Padmanaban 2023-01-09 21:40:05 +00:00
parent c91476980e
commit ba509f0add
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
Fix a race condition when creating or updating the stepwise plugin's cache, which could occur when multiple xdist worker nodes try to simultaneously update the stepwise plugin's cache.

View File

@ -49,6 +49,8 @@ def pytest_sessionfinish(session: Session) -> None:
if not session.config.getoption("stepwise"):
assert session.config.cache is not None
if hasattr(session.config, "workerinput"):
# Do not update cache if this process is a xdist worker to prevent
# race conditions (#10641).
return
# Clear the list of failing tests if the plugin is not active.
session.config.cache.set(STEPWISE_CACHE_DIR, [])
@ -122,5 +124,7 @@ class StepwisePlugin:
def pytest_sessionfinish(self) -> None:
if hasattr(self.config, "workerinput"):
# Do not update cache if this process is a xdist worker to prevent
# race conditions (#10641).
return
self.cache.set(STEPWISE_CACHE_DIR, self.lastfailed)