@@ -169,6 +169,7 @@ def test_workflow_test_with_serve(self):
169169 """
170170 Test testing a Galaxy workflow with the serve flag. Even though
171171 this is technically using the test subcommand it is easier to test here
172+ so we can use the UsesServeCommand methods
172173 """
173174 cat = os .path .join (PROJECT_TEMPLATES_DIR , "demo" , "cat.xml" )
174175 test_artifact = os .path .join (TEST_DATA_DIR , "wf2.ga" )
@@ -189,16 +190,16 @@ def test_workflow_test_with_serve(self):
189190 workflows = user_gi .workflows .get_workflows ()
190191 assert len (workflows ) == 1
191192 assert workflows [0 ]['name' ] == 'TestWorkflow1'
192- histories = user_gi .histories .get_histories ()
193+ histories = user_gi .histories .get_histories (name = "CWL Target History" )
193194 assert len (histories ) == 1
194195 for _ in range (60 ):
195- state_ids = user_gi .histories .show_history (histories [0 ]['id' ])[ 'state_ids' ]
196- if len (state_ids [ 'ok' ] ) == 3 :
196+ state_ids = [ d [ 'state' ] for d in user_gi .histories .show_history (histories [0 ]['id' ], contents = True ) ]
197+ if len (state_ids ) == 3 and set ( state_ids ) == { 'ok' ,} :
197198 break
198- time . sleep ( 5 )
199- datasets = user_gi . histories . show_history ( histories [ 0 ][ 'id' ], contents = True )
200- assert len ( datasets ) == 3
201- assert all ([ d [ 'state' ] == 'ok' for d in datasets ] )
199+ else :
200+ time . sleep ( 10 )
201+ else :
202+ raise Exception ( "Datasets did not reach an ok state within 10 minutes." )
202203
203204 @skip_if_environ ("PLANEMO_SKIP_GALAXY_TESTS" )
204205 def test_serve_profile (self ):
0 commit comments