From 886e297cd473ded71b0d01b89bd7f63bea5068e9 Mon Sep 17 00:00:00 2001 From: Jacob Nesbitt Date: Mon, 25 Mar 2024 13:19:00 -0400 Subject: [PATCH] Fix flakey test This test was fetching an unordered list and comparing it to an ordered list, resulting in inconsistent failures. --- dandiapi/api/tests/test_asset.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dandiapi/api/tests/test_asset.py b/dandiapi/api/tests/test_asset.py index 14588dec9..f1f381ecc 100644 --- a/dandiapi/api/tests/test_asset.py +++ b/dandiapi/api/tests/test_asset.py @@ -1539,4 +1539,5 @@ def test_asset_rest_glob(api_client, asset_factory, version, glob_pattern, expec {'glob': glob_pattern}, ) - assert expected_paths == [asset['path'] for asset in resp.json()['results']] + # Sort both lists before comparing since ordering is not considered + assert sorted(expected_paths) == sorted([asset['path'] for asset in resp.json()['results']])