-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #522 from jsnoble/stop_job_timeouts
fixed stop job timeout issues resolves #434
- Loading branch information
Showing
6 changed files
with
80 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
'use strict'; | ||
|
||
var _ = require('lodash'); | ||
var Promise = require('bluebird'); | ||
var misc = require('../../misc')(); | ||
var wait = require('../../wait')(); | ||
|
||
module.exports = function() { | ||
var teraslice = misc.teraslice(); | ||
|
||
describe('worker allocation', function() { | ||
|
||
it('should cycle through after state changes with other jobs running', function(done) { | ||
var job_spec1 = misc.newJob('generator'); | ||
var job_spec2 = misc.newJob('generator'); | ||
var job1_id; | ||
var job2_id; | ||
job_spec2.operations[1].name = 'second_generator'; | ||
|
||
Promise.all([teraslice.jobs.submit(job_spec1), teraslice.jobs.submit(job_spec2)]) | ||
.spread(function(job1, job2) { | ||
job1_id = job1.id(); | ||
job2_id = job2.id(); | ||
expect(job1_id).toBeDefined(); | ||
expect(job2_id).toBeDefined(); | ||
|
||
return job1.waitForStatus('running') | ||
.then(function() { | ||
return job1.pause(); | ||
}) | ||
.then(function() { | ||
return job1.waitForStatus('paused'); | ||
}) | ||
.then(function() { | ||
return job1.resume(); | ||
}) | ||
.then(function() { | ||
return job1.waitForStatus('running'); | ||
}) | ||
.then(function() { | ||
return job1.stop(); | ||
}) | ||
.then(function() { | ||
return job1.waitForStatus('stopped'); | ||
}) | ||
.then(function() { | ||
return job2.stop(); | ||
}) | ||
.then(function() { | ||
return job2.waitForStatus('stopped'); | ||
}) | ||
}) | ||
.catch(fail) | ||
.finally(done); | ||
}); | ||
}); | ||
|
||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "generator", | ||
"slicers": 1, | ||
"lifecycle": "persistent", | ||
"workers": 3, | ||
"operations": [ | ||
{ | ||
"_op": "elasticsearch_data_generator", | ||
"size": 1000, | ||
"stress_test": false | ||
}, | ||
{ | ||
"_op": "noop" | ||
} | ||
] | ||
} |
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