Skip to content

Commit 8ad443d

Browse files
committed
Attempt to fix transient API test failures.
I don't really think this will fix the problem - this seems like a deep bug in Galaxy to me but it might be worth attempting. The two things I did here is wait on the testing initial condition (the job search can find the job before we delete the dataset) in case there is a race condition of some sort and then use the more percise dataset deletion route in case there is a clash between collections and datasets. I think we defer to the dataset so this second thing probably won't help but I think the more percise endpoint simplifies the test and ensures this isn't the problem.
1 parent 29898ba commit 8ad443d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/galaxy_test/api/test_jobs.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -860,17 +860,22 @@ def test_search_delete_hdca_output(self, history_id):
860860
}
861861
)
862862
tool_response = self._job_search(tool_id="collection_creates_list", history_id=history_id, inputs=inputs)
863-
output_id = tool_response.json()["outputs"][0]["id"]
863+
output_dict = tool_response.json()["outputs"][0]
864+
assert output_dict["history_content_type"] == "dataset"
865+
output_id = output_dict["id"]
866+
# Wait for job search to register the job, make sure initial conditions set.
867+
search_payload = self._search_payload(history_id=history_id, tool_id="collection_creates_list", inputs=inputs)
868+
self._search(search_payload, expected_search_count=1)
864869
# We delete a single tool output, no job should be returned
865-
delete_respone = self._delete(f"histories/{history_id}/contents/{output_id}")
866-
self._assert_status_code_is(delete_respone, 200)
870+
delete_response = self._delete(f"histories/{history_id}/contents/datasets/{output_id}")
871+
self._assert_status_code_is(delete_response, 200)
867872
search_payload = self._search_payload(history_id=history_id, tool_id="collection_creates_list", inputs=inputs)
868873
self._search(search_payload, expected_search_count=0)
869874
tool_response = self._job_search(tool_id="collection_creates_list", history_id=history_id, inputs=inputs)
870875
output_collection_id = tool_response.json()["output_collections"][0]["id"]
871876
# We delete a collection output, no job should be returned
872-
delete_respone = self._delete(f"histories/{history_id}/contents/dataset_collections/{output_collection_id}")
873-
self._assert_status_code_is(delete_respone, 200)
877+
delete_response = self._delete(f"histories/{history_id}/contents/dataset_collections/{output_collection_id}")
878+
self._assert_status_code_is(delete_response, 200)
874879
search_payload = self._search_payload(history_id=history_id, tool_id="collection_creates_list", inputs=inputs)
875880
self._search(search_payload, expected_search_count=0)
876881

0 commit comments

Comments
 (0)