Files
pytest2/testing
Miro Hrončok 223e030604 XFAIL TestLocalPath.test_make_numbered_dir_multiprocess_safe (#11611)
The tested py.path.local.make_numbered_dir function is *not*
multiprocess safe, because is uses os.listdir which itself is not.

The os.listdir documentation explicitly states that:

> If a file is removed from or added to the directory during the call
> of this function, whether a name for that file be included is unspecified.

This can lead to a race when:

 1. process A attempts to create directory N
 2. the creation fails, as another process already created it in the meantime
 3. process A calls listdir to determine a more recent maxnum
 4. processes B+ repeatedly create newer directories and they delete directory N
 5. process A doesn't have directory N or any newer directory in listdir result
 6. process A attempts to create directory N again and raises

For details, see https://github.com/pytest-dev/pytest/issues/11603#issuecomment-1805708144
and bellow.

Additionally, the test itself has a race in batch_make_numbered_dirs.
When this functions attempts to write to repro-N/foo,
repro-N may have already been removed by another process.

For details, see https://github.com/pytest-dev/pytest/issues/11603#issuecomment-1804714313
and bellow.

---

The tested py.path.local.make_numbered_dir function is not used in pytest.
There is a different implementation in _pytest.pathlib.

Closes #11603
2023-11-14 11:41:35 -03:00
..
2021-03-07 15:01:39 +01:00
2020-08-03 10:10:43 +03:00
2023-01-04 10:30:28 +01:00
2023-06-20 04:55:40 -07:00
2023-06-30 14:55:42 -07:00
2022-10-14 13:53:06 -04:00
2023-06-30 14:55:42 -07:00
2020-10-05 18:33:17 -07:00
2023-06-20 04:55:40 -07:00
2023-08-26 22:13:24 +03:00
2023-06-20 04:55:40 -07:00
2023-06-20 04:55:40 -07:00
2021-12-27 09:23:15 -03:00
2023-06-20 04:55:40 -07:00
2023-06-30 14:55:42 -07:00
2023-06-20 04:55:40 -07:00