Skip to content

Commit

Permalink
Merge pull request #155 from RobertLuptonTheGood/tickets/DM-45921
Browse files Browse the repository at this point in the history
DM-45921: Protect stat/open call for database load
  • Loading branch information
timj authored Aug 22, 2024
2 parents 8a99e13 + 83bafe8 commit 32ddee3
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 209 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Run CI
run: |
./ci/script.sh
ci-csh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install csh
Expand All @@ -43,9 +44,9 @@ jobs:
ci-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Run CI
Expand Down
15 changes: 10 additions & 5 deletions python/eups/stack/ProductStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,16 @@ def reload(self, flavors=None, persistDir=None, verbose=0):

for flavor in flavors:
fileName = self._persistPath(flavor,persistDir)
self.modtimes[fileName] = os.stat(fileName).st_mtime
with open(fileName, "rb") as fd:
lookup = pickle.load(fd)

self.lookup[flavor] = lookup
try:
self.modtimes[fileName] = os.stat(fileName).st_mtime
with open(fileName, "rb") as fd:
lookup = pickle.load(fd)
except FileNotFoundError:
# Remove the stat call value if that succeeded but the open
# failed.
self.modtimes.pop(fileName)
else:
self.lookup[flavor] = lookup

@staticmethod
def findCachedFlavors(dir):
Expand Down
26 changes: 13 additions & 13 deletions tests/testAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

tests = []
for t in [
"testApp",
"testCmd",
"testDeprecated",
"testDb",
"testEups",
"testMisc",
"testProduct",
"testStack",
"testTable",
"testTags",
"testEupspkg",
"testSetups",
"testEupsIntegration",
"test_app",
"test_cmd",
"test_deprecated",
"test_db",
"test_eups2",
"test_misc",
"test_product",
"test_stack",
"test_table",
"test_tags",
"test_eupspkg",
"test_setups",
"test_eups_integration",
]:
tests += __import__(t).suite()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
184 changes: 0 additions & 184 deletions tests/test_eups.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 32ddee3

Please sign in to comment.