forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[17.01] By default, do not allow workflow invocations to schedule ind…
…efinitely. Give up after a month but allow admins to reduce this amount as well.
- Loading branch information
Showing
9 changed files
with
97 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
test/integration/test_maximum_worklfow_invocation_duration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"""Integration tests for maximum workflow invocation duration configuration option.""" | ||
|
||
import time | ||
|
||
from json import dumps | ||
|
||
from base import integration_util | ||
from base.populators import ( | ||
DatasetPopulator, | ||
WorkflowPopulator, | ||
) | ||
|
||
|
||
class MaximumWorkflowInvocationDurationTestCase(integration_util.IntegrationTestCase): | ||
"""Start a Pulsar job.""" | ||
|
||
framework_tool_and_types = True | ||
|
||
def setUp( self ): | ||
super( MaximumWorkflowInvocationDurationTestCase, self ).setUp() | ||
self.dataset_populator = DatasetPopulator( self.galaxy_interactor ) | ||
self.workflow_populator = WorkflowPopulator( self.galaxy_interactor ) | ||
|
||
@classmethod | ||
def handle_galaxy_config_kwds(cls, config): | ||
config["maximum_workflow_invocation_duration"] = 20 | ||
|
||
def do_test(self): | ||
workflow = self.workflow_populator.load_workflow_from_resource("test_workflow_pause") | ||
workflow_id = self.workflow_populator.create_workflow(workflow) | ||
history_id = self.dataset_populator.new_history() | ||
hda1 = self.dataset_populator.new_dataset(history_id, content="1 2 3") | ||
index_map = { | ||
'0': dict(src="hda", id=hda1["id"]) | ||
} | ||
request = {} | ||
request["history"] = "hist_id=%s" % history_id | ||
request[ "inputs" ] = dumps(index_map) | ||
request[ "inputs_by" ] = 'step_index' | ||
url = "workflows/%s/invocations" % (workflow_id) | ||
invocation_response = self._post(url, data=request) | ||
invocation_url = url + "/" + invocation_response.json()["id"] | ||
time.sleep(5) | ||
state = self._get(invocation_url).json()["state"] | ||
assert state != "failed", state | ||
time.sleep(35) | ||
state = self._get(invocation_url).json()["state"] | ||
assert state == "failed", state |