Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: create workaround for Python 3.8 oslo-related lock file creation…
… bug
  • Loading branch information
LennartPurucker committed Oct 16, 2024
commit 2fe34f31fcfc2f6e11db9874144b59a9a0fd9d8e
2 changes: 1 addition & 1 deletion openml/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def tearDown(self) -> None:
"""Tear down the test"""
os.chdir(self.cwd)
try:
shutil.rmtree(self.workdir, ignore_errors=True)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I introduced this in another PR to fix this issue but it did not help. Hence, I removed it here again.

shutil.rmtree(self.workdir)
except PermissionError as e:
if os.name != "nt":
# one of the files may still be used by another process
Expand Down
6 changes: 6 additions & 0 deletions tests/test_datasets/test_dataset_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import itertools
import sys
import os
import random
import shutil
Expand Down Expand Up @@ -1919,6 +1920,11 @@ def isolate_for_test():
t.tearDown()


# On Python 3.8, an unexplainable oslo concurrency-related bug will make a lock file from oslo
# be created after deleting the tmp dir and existing the tests. Moreover, we did not find a way
# to delete the new lock file. The test will pass but the git workflow will fail because new
# files are present in the git repo. The skipif is a workaround to avoid the issue.
@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires python3.9 or higher.")
@pytest.mark.parametrize(
("with_data", "with_qualities", "with_features"),
itertools.product([True, False], repeat=3),
Expand Down