Merge pull request #170 from overleaf/jpa-import-141

[DockerRunner] destroyOldContainers: fix a race confition
This commit is contained in:
Brian Gough authored and GitHub committed 2020-06-02 09:04:59 +01:00
commit 8c60406bb5
2 files changed
+6 -3

No files matched your search

+3 -3
View File
@@ -688,19 +688,19 @@ describe('DockerRunner', function() {
it('should destroy old containers', function() {
this.DockerRunner.destroyContainer.callCount.should.equal(1)
return this.DockerRunner.destroyContainer
.calledWith('/project-old-container-name', 'old-container-id')
.calledWith('project-old-container-name', 'old-container-id')
.should.equal(true)
})
it('should not destroy new containers', function() {
return this.DockerRunner.destroyContainer
.calledWith('/project-new-container-name', 'new-container-id')
.calledWith('project-new-container-name', 'new-container-id')
.should.equal(false)
})
it('should not destroy non-project containers', function() {
return this.DockerRunner.destroyContainer
.calledWith('/totally-not-a-project-container', 'some-random-id')
.calledWith('totally-not-a-project-container', 'some-random-id')
.should.equal(false)
})