Merge branch 'master' into bg-use-lodash
This commit is contained in:
@@ -36,7 +36,6 @@ describe('DockerRunner', function() {
|
||||
'logger-sharelatex': (this.logger = {
|
||||
log: sinon.stub(),
|
||||
error: sinon.stub(),
|
||||
err: sinon.stub(),
|
||||
info: sinon.stub(),
|
||||
warn: sinon.stub()
|
||||
}),
|
||||
@@ -389,63 +388,6 @@ describe('DockerRunner', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('when inspect always fails with EPIPE error', function() {
|
||||
beforeEach(function() {
|
||||
this.error = new Error('write EPIPE')
|
||||
this.container.inspect = sinon.stub().yields(this.error)
|
||||
this.container.start = sinon.stub().yields()
|
||||
|
||||
this.DockerRunner.startContainer(
|
||||
this.options,
|
||||
this.volumes,
|
||||
() => {},
|
||||
this.callback
|
||||
)
|
||||
})
|
||||
|
||||
it('should retry once', function() {
|
||||
sinon.assert.callOrder(
|
||||
this.container.inspect,
|
||||
this.container.inspect,
|
||||
this.callback
|
||||
)
|
||||
})
|
||||
|
||||
it('should call back with error', function() {
|
||||
sinon.assert.calledWith(this.callback, this.error)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when inspect fails once with EPIPE error', function() {
|
||||
beforeEach(function() {
|
||||
this.container.inspect = sinon.stub()
|
||||
this.container.inspect.onFirstCall().yields(new Error('write EPIPE'))
|
||||
this.container.inspect.onSecondCall().yields()
|
||||
this.container.start = sinon.stub().yields()
|
||||
|
||||
this.DockerRunner.startContainer(
|
||||
this.options,
|
||||
this.volumes,
|
||||
() => {},
|
||||
this.callback
|
||||
)
|
||||
})
|
||||
|
||||
it('should retry once and start container', function() {
|
||||
sinon.assert.callOrder(
|
||||
this.container.inspect,
|
||||
this.container.inspect,
|
||||
this.DockerRunner.attachToContainer,
|
||||
this.container.start,
|
||||
this.callback
|
||||
)
|
||||
})
|
||||
|
||||
it('should call back without error', function() {
|
||||
sinon.assert.calledWith(this.callback, null)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the container does not exist', function() {
|
||||
beforeEach(function() {
|
||||
const exists = false
|
||||
|
||||
Reference in New Issue
Block a user