Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory /tmp full of QGIS temporary files after ctest run #48884

Open
1 of 2 tasks
strk opened this issue Jun 6, 2022 · 5 comments · Fixed by #57606
Open
1 of 2 tasks

Directory /tmp full of QGIS temporary files after ctest run #48884

strk opened this issue Jun 6, 2022 · 5 comments · Fixed by #57606
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! testsuite Issue related to testsuite

Comments

@strk
Copy link
Contributor

strk commented Jun 6, 2022

What is the bug or the crash?

The /tmp/ directory is filled with temporary files created by QGIS testsuite and not cleaned up on completion.
This is a partial list:

dot-qgis
oauth2-cache
QGIS-TEST-gAWuVQ
QGIS-TEST.RnZLfj
srs6.db

It would help if at least those files were in a SINGLE directory. Maybe it can be done with a fixture creating such temporary dir..

Steps to reproduce the issue

Run any test, for example:

xvfb-run ctest --output-on-failure -R gui_datumtransform

Check the /tmp directory before and after that run

Versions

Current master as of 6 June 2022, aka ac7b711

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

No response

@strk strk added Bug Either a bug report, or a bug fix. Let's hope for the latter! testsuite Issue related to testsuite labels Jun 6, 2022
@strk
Copy link
Contributor Author

strk commented Sep 30, 2022

This is still an issue, which prevents me from running the testsuite w/out filling up my disk.

@strk
Copy link
Contributor Author

strk commented Sep 30, 2022

As reported in #50415 there's something deep in core that triggers proliferation of files too.

See what happens when running a SINGLE qgis test:

while :; do TMPDIR=/tmp/qgis ctest -R ^PyQgsServerLocaleOverride > /dev/null && du -s /tmp/qgis; done
16028   /tmp/qgis
17156   /tmp/qgis
18284   /tmp/qgis
19412   /tmp/qgis

That's over 1kb growth on every run of that specific test (it was just a random one).

@strk strk self-assigned this Sep 30, 2022
@strk
Copy link
Contributor Author

strk commented Oct 19, 2022

The python start_app() method defined in package qgis.testing is responsible on itself for the creation of 3 directories, one of which full of things. Example data created (and not removed) by running an empty python test only calling start_app():

/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/Unknown Organization
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/Unknown Organization/test_qgsfields.py.ini
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/qgis.db
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/fonts
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/bookmarks.xml
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/symbology-style.db
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/qgis-auth.db
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/palettes
/tmp/qgis_tests/QGIS-PythonTestConfigPathj8vne5tm/profiles/default/oauth2-cache
/tmp/qgis_tests/test_qgsfields.py-vdyVNh
/tmp/qgis_tests/test_qgsfields.py-cBMsGe

Everything is under /tmp/qgis_tests because I've exported TMPDIR=/tmp/qgis_tests to simplify cleaning up all those files, which I think should be cleaned up automatically upon process end instead.

@strk
Copy link
Contributor Author

strk commented Oct 19, 2022

The temporary python test config path cleanup is implemented in PR #50608

strk added a commit that referenced this issue Oct 20, 2022
strk added a commit to strk/QGIS that referenced this issue Oct 20, 2022
strk added a commit that referenced this issue Oct 20, 2022
marcu pushed a commit to marcu/QGIS that referenced this issue Oct 23, 2022
strk added a commit to strk/QGIS that referenced this issue May 29, 2024
strk added a commit to strk/QGIS that referenced this issue May 29, 2024
Defines a QGIS_TEST_TMP_DIR variable in top-level CMakeLists.txt
and then defines QGIS_CUSTOM_CONFIG_PATH and TMPDIR to be under
that directory for individual tests.

Closes qgisGH-50587
Closes qgisGH-48884
strk added a commit to strk/QGIS that referenced this issue May 29, 2024
Defines a QGIS_TEST_TMP_DIR variable in top-level CMakeLists.txt
and then defines QGIS_CUSTOM_CONFIG_PATH and TMPDIR to be under
that directory for individual tests.

Closes qgisGH-50587
Closes qgisGH-48884
strk added a commit to strk/QGIS that referenced this issue May 29, 2024
Defines a QGIS_TEST_TMP_DIR variable in top-level CMakeLists.txt
and then defines QGIS_CUSTOM_CONFIG_PATH and TMPDIR to be under
that directory for individual tests.

Closes qgisGH-50587
Closes qgisGH-48884
@strk strk closed this as completed in 2e85f6f Jun 21, 2024
@strk
Copy link
Contributor Author

strk commented Jun 29, 2024

Re-opened by revert, will be closed again by merging GH-57934

@strk strk reopened this Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! testsuite Issue related to testsuite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant