Skip to content

Commit e23a5e4

Browse files
committed
Fix KeyError problems in _fetch_testcases_raw()
1 parent 254eb05 commit e23a5e4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

reframe/frontend/reporting/storage.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,16 @@ def _fetch_testcases_raw(self, condition):
213213
session_uuid, run_index, test_index = uuid.split(':')
214214
run_index = int(run_index)
215215
test_index = int(test_index)
216-
report = sessions[session_uuid]
217-
testcases.append(
218-
report['runs'][run_index]['testcases'][test_index],
219-
)
216+
try:
217+
report = sessions[session_uuid]
218+
except KeyError:
219+
# Since we do two separate queries, new testcases may have been
220+
# inserted to the DB meanwhile, so we ignore unknown sessions
221+
continue
222+
else:
223+
testcases.append(
224+
report['runs'][run_index]['testcases'][test_index],
225+
)
220226

221227
return testcases
222228

0 commit comments

Comments
 (0)