diff --git a/test/integration_test.py b/test/integration_test.py index 32d81a09e..0298fd79a 100644 --- a/test/integration_test.py +++ b/test/integration_test.py @@ -386,13 +386,23 @@ def test_catalog_listing(self): def test_snapshot_listing(self): """ - Test with a small page size to be sure paging works + Test with small page sizes to make sure paging works. """ - page_size = 5 - with mock.patch.object(TDRClient, 'page_size', page_size): - paged_snapshots = self._public_tdr_client.snapshot_names_by_id() - snapshots = self._public_tdr_client.snapshot_names_by_id() - self.assertEqual(snapshots, paged_snapshots) + # Without a filter, the test takes so long that there's a real risk of + # failure due to new snapshots being added mid-test. + # + snapshot_filters_by_deployment = { + 'dev': 'hca_dev_5', + 'anvildev': 'anvil_', + 'prod': '_dcp37', + 'anvilprod': 'anvil_page_' + } + filter = snapshot_filters_by_deployment[config.main_deployment_stage] + for page_size in 1, 2: + with mock.patch.object(TDRClient, 'page_size', page_size): + paged_snapshots = self._public_tdr_client.snapshot_names_by_id(filter=filter) + snapshots = self._public_tdr_client.snapshot_names_by_id(filter=filter) + self.assertEqual(snapshots, paged_snapshots) def test_indexing(self):