File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464 git config --global user.email 'not@mail.com'
6565 git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
6666 git commit -am "$last_commit"
67- git push
67+ git diff --quiet @{u} HEAD || git push
Original file line number Diff line number Diff line change @@ -106,8 +106,7 @@ jobs:
106106 run : | # we need a separate step because of the bash-specific if-statement in the previous one.
107107 pytest -n 4 --durations=20 --dist load -sv --reruns 5 --reruns-delay 1
108108 - name : Check for files left behind by test
109- # skip 3.8 as it fails only for Python 3.8 for no explainable reason.
110- if : matrix.os != 'windows-latest' && matrix.python-version != '3.8' && always()
109+ if : matrix.os != 'windows-latest' && always()
111110 run : |
112111 before="${{ steps.status-before.outputs.BEFORE }}"
113112 after="$(git status --porcelain -b)"
Original file line number Diff line number Diff line change 2525
2626import logging
2727import os
28+ import shutil
2829from pathlib import Path
2930import pytest
3031
@@ -164,6 +165,15 @@ def pytest_sessionfinish() -> None:
164165 # Local file deletion
165166 new_file_list = read_file_list ()
166167 compare_delete_files (file_list , new_file_list )
168+
169+ # Delete any test dirs that remain
170+ # In edge cases due to a mixture of pytest parametrization and oslo concurrency,
171+ # some file lock are created after leaving the test. This removes these files!
172+ test_files_dir = Path (__file__ ).parent .parent / "openml"
173+ for f in test_files_dir .glob ("tests.*" ):
174+ if f .is_dir ():
175+ shutil .rmtree (f )
176+
167177 logger .info ("Local files deleted" )
168178
169179 logger .info (f"{ worker } is killed" )
You can’t perform that action at this time.
0 commit comments