-
Notifications
You must be signed in to change notification settings - Fork 966
/
test_job_recovery.py
67 lines (52 loc) · 2.47 KB
/
test_job_recovery.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""Integration tests for the job recovery after server restarts."""
import os
from galaxy_test.base.populators import DatasetPopulator
from galaxy_test.driver import integration_util
SCRIPT_DIRECTORY = os.path.abspath(os.path.dirname(__file__))
DELAY_JOB_CONFIG_FILE = os.path.join(SCRIPT_DIRECTORY, "delay_job_conf.yml")
SIMPLE_JOB_CONFIG_FILE = os.path.join(SCRIPT_DIRECTORY, "simple_job_conf.xml")
class TestJobRecoveryBeforeHandledIntegration(integration_util.IntegrationTestCase):
dataset_populator: DatasetPopulator
framework_tool_and_types = True
def setUp(self) -> None:
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
@classmethod
def handle_galaxy_config_kwds(cls, config) -> None:
super().handle_galaxy_config_kwds(config)
config["job_config_file"] = SIMPLE_JOB_CONFIG_FILE
config["server_name"] = "moo"
def handle_reconfigure_galaxy_config_kwds(self, config) -> None:
config["server_name"] = "main"
def test_recovery(self) -> None:
history_id = self.dataset_populator.new_history()
self.dataset_populator.run_tool_raw(
"exit_code_oom",
{},
history_id,
)
self.restart(handle_reconfig=self.handle_reconfigure_galaxy_config_kwds)
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
self.dataset_populator.wait_for_history(history_id, assert_ok=True)
class TestJobRecoveryAfterHandledIntegration(integration_util.IntegrationTestCase):
dataset_populator: DatasetPopulator
framework_tool_and_types = True
def setUp(self) -> None:
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
@classmethod
def handle_galaxy_config_kwds(cls, config) -> None:
super().handle_galaxy_config_kwds(config)
config["job_config_file"] = DELAY_JOB_CONFIG_FILE
def handle_reconfigure_galaxy_config_kwds(self, config) -> None:
config["job_config_file"] = SIMPLE_JOB_CONFIG_FILE
def test_recovery(self) -> None:
history_id = self.dataset_populator.new_history()
self.dataset_populator.run_tool_raw(
"exit_code_oom",
{},
history_id,
)
self.restart(handle_reconfig=self.handle_reconfigure_galaxy_config_kwds)
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
self.dataset_populator.wait_for_history(history_id, assert_ok=True)