Skip to content

Commit

Permalink
Fix catalog_crash to return stable lists
Browse files Browse the repository at this point in the history
  • Loading branch information
willkg committed Aug 30, 2024
1 parent 57caeab commit 8feb90a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion socorro/external/fs/crashstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def catalog_crash(self, crash_id):
self.get_processed_crash(crash_id)
contents.append("fs_processed_crash")

return contents
return list(sorted(contents))

def delete_crash(self, crash_id):
parent_dir = self._get_radixed_parent_directory(crash_id)
Expand Down
2 changes: 1 addition & 1 deletion socorro/external/gcs/crashstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def catalog_crash(self, crash_id):
f"could not parse dump_names: gs://{self.bucket}/{key}"
)

return contents
return list(sorted(contents))

def delete_crash(self, crash_id):
# delete raw and processed crash
Expand Down
6 changes: 3 additions & 3 deletions socorro/tests/external/fs/test_fspermanentstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ def test_catalog_crash(self, tmp_path):
fs.save_raw_crash(raw_crash=raw_crash, dumps=dumps, crash_id=crash_id)
fs.save_processed_crash(raw_crash=raw_crash, processed_crash=processed_crash)

assert fs.catalog_crash(crash_id=crash_id) == [
"fs_raw_crash",
"fs_dump_upload_file_minidump",
assert list(sorted(fs.catalog_crash(crash_id=crash_id))) == [
"fs_dump_memory_report",
"fs_dump_upload_file_minidump",
"fs_processed_crash",
"fs_raw_crash",
]

def test_delete_crash(self, tmp_path):
Expand Down
6 changes: 3 additions & 3 deletions socorro/tests/external/gcs/test_crashstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ def test_catalog_crash(self, gcs_helper):
)

assert crashstorage.catalog_crash(crash_id=crash_id) == [
"gcs_raw_crash",
"gcs_processed_crash",
"gcs_dump_names",
"gcs_dump_dump",
"gcs_dump_memory_report",
"gcs_dump_names",
"gcs_processed_crash",
"gcs_raw_crash",
]

def test_delete_crash(self, gcs_helper):
Expand Down

0 comments on commit 8feb90a

Please sign in to comment.