-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allocating, de-allocating, and then re-allocating slaves should work.
This PR should fix #313 Currently, when slaves are added, removed, and added again to a build, the build fails to complete successfully.
- Loading branch information
TJ Lee
committed
Jun 23, 2016
1 parent
e46fc84
commit 8623b08
Showing
9 changed files
with
118 additions
and
45 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
30 changes: 30 additions & 0 deletions
30
test/functional/master/test_deallocation_and_allocation_of_slaves_mid_build.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,30 @@ | ||
import os | ||
import tempfile | ||
import yaml | ||
|
||
from test.framework.functional.base_functional_test_case import BaseFunctionalTestCase | ||
from test.functional.job_configs import JOB_WITH_SLEEPS | ||
|
||
|
||
class TestDeallocationAndAllocationOfSlavesMidBuild(BaseFunctionalTestCase): | ||
def test_build_completes_after_allocating_deallocating_and_reallocating_slaves_to_build(self): | ||
master = self.cluster.start_master() | ||
# Only one slave, with one executor. This means that the slave should be able to | ||
# theoretically finish the build in 5 seconds, as this job definition has 5 atoms, | ||
# with each sleeping for 1 second. | ||
self.cluster.start_slaves(1, num_executors_per_slave=1, start_port=43001) | ||
project_dir = tempfile.TemporaryDirectory() | ||
build_resp = master.post_new_build({ | ||
'type': 'directory', | ||
'config': yaml.safe_load(JOB_WITH_SLEEPS.config[os.name])['BasicSleepingJob'], | ||
'project_directory': project_dir.name, | ||
}) | ||
build_id = build_resp['build_id'] | ||
master.block_until_build_started(build_id, timeout=10) | ||
master.graceful_shutdown_slaves_by_id([1]) | ||
self.cluster.block_until_n_slaves_dead(num_slaves=1, timeout=10) | ||
self.cluster.kill_slaves(kill_gracefully=False) | ||
self.assert_build_status_contains_expected_data(build_id, {'status': 'BUILDING'}) | ||
self.cluster.start_slaves(1, num_executors_per_slave=1, start_port=43001) | ||
master.block_until_build_finished(build_id, timeout=10) | ||
self.assert_build_has_successful_status(build_id) |
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