s3/test: do not keep the tempdir forever

by default, up to 3 temporary directories are kept by pytest.
but we run only a single time for each of the $TMPDIR. per
our recent observation, it takes a lot more time for jenkins
to scan the tempdir if we use it for scylla's rundir.

so, to alleviate this symptom, we just keep up to one failed
session in the tempdir. if the test passes, the tempdir
created by pytest will be nuked. normally it is located at
scylladb/testlog/${mode}/pytest-of-$(whoami).

see also
https://docs.pytest.org/en/7.3.x/reference/reference.html#confval-tmp_path_retention_policy

Refs #14690
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes #14735

[xemul: Withdrawing from PR's comments

    object_store is the only test which

        is using tmpdir fixture
        starts / stops scylla by itself
        and put the rundir of scylla in its own tmpdir

    we don't register the step of cleaning up [the temp dir] using the utilities provided by
    cql-pytest. we rely on pytest to perform the cleanup. while cql-pytest performs the
    cleanup using a global registry.
]
This commit is contained in:
Kefu Chai
2023-07-18 12:43:38 +08:00
committed by Pavel Emelyanov
parent 69e22de54d
commit 4661671220

View File

@@ -1,2 +1,4 @@
[pytest]
asyncio_mode = auto
tmp_path_retention_count = 1
tmp_path_retention_policy = failed