Skip to content

Commit

Permalink
Merge pull request #8 from boite/develop
Browse files Browse the repository at this point in the history
Disable process timeout (unlimited runtime).
  • Loading branch information
joostfaassen committed Sep 30, 2016
2 parents cb5403e + 41528b9 commit 5b8dcf5
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Command/FsChownCommand.php
Expand Up @@ -166,6 +166,7 @@ private function getProcess($arguments)
return $this
->processBuilder
->setArguments($arguments)
->setTimeout(0.0)
->getProcess()
;
}
Expand Down
1 change: 1 addition & 0 deletions src/Model/FsMount.php
Expand Up @@ -77,6 +77,7 @@ private function getProcess($arguments)
return $this
->processBuilder
->setArguments($arguments)
->setTimeout(0.0)
->getProcess()
;
}
Expand Down
35 changes: 34 additions & 1 deletion test/Command/FsChownCommandTest.php
Expand Up @@ -32,7 +32,7 @@ protected function setUp()
;
$this->processBuilder = $this
->getMockBuilder(ProcessBuilder::class)
->setMethods(array('setArguments', 'getProcess'))
->setMethods(array('setArguments', 'setTimeout', 'getProcess'))
->getMock()
;
$this->processBuilder
Expand All @@ -43,6 +43,10 @@ protected function setUp()
->method('setArguments')
->willReturnSelf()
;
$this->processBuilder
->method('setTimeout')
->willReturnSelf()
;
$this->lookup = $this
->getMockBuilder(AclObjectLookupInterface::class)
->getMock()
Expand Down Expand Up @@ -225,6 +229,12 @@ public function testChownChangesOnlyUserOwnershipWhenGroupOwnershipMatchesArg()
)
)
;
$this
->processBuilder
->expects($this->once())
->method('setTimeout')
->with($this->equalTo(0.0))
;
$this
->process
->method('run')
Expand Down Expand Up @@ -292,6 +302,12 @@ public function testChownChangesOnlyGroupOwnershipWhenUserOwnershipMatchesArg()
)
)
;
$this
->processBuilder
->expects($this->once())
->method('setTimeout')
->with($this->equalTo(0.0))
;
$this
->process
->method('run')
Expand Down Expand Up @@ -364,6 +380,12 @@ public function testChownThrowsExceptionWhenItFailsToChangesOwnership()
)
)
;
$this
->processBuilder
->expects($this->once())
->method('setTimeout')
->with($this->equalTo(0.0))
;
$this
->process
->method('run')
Expand Down Expand Up @@ -428,6 +450,12 @@ public function testChownChangesOwnership()
)
)
;
$this
->processBuilder
->expects($this->once())
->method('setTimeout')
->with($this->equalTo(0.0))
;
$this
->process
->method('run')
Expand Down Expand Up @@ -484,6 +512,11 @@ public function testChownDoesNotChangeOwnershipInCheckMode()
->expects($this->never())
->method('setArguments')
;
$this
->processBuilder
->expects($this->never())
->method('setTimeout')
;
$this
->process
->expects($this->never())
Expand Down
24 changes: 23 additions & 1 deletion test/Model/FsMountTest.php
Expand Up @@ -23,7 +23,7 @@ protected function setUp()
;
$this->processBuilder = $this
->getMockBuilder(ProcessBuilder::class)
->setMethods(array('setArguments', 'getProcess'))
->setMethods(array('setArguments', 'setTimeout', 'getProcess'))
->getMock()
;
$this->processBuilder
Expand All @@ -34,6 +34,10 @@ protected function setUp()
->method('setArguments')
->willReturnSelf()
;
$this->processBuilder
->method('setTimeout')
->willReturnSelf()
;
}

/**
Expand Down Expand Up @@ -83,6 +87,12 @@ public function testMountedWithMountedFilesystemWillReturnTrue()
->method('setArguments')
->with($this->equalTo(array('mountpoint', '-q', '/mnt/point')))
;
$this
->processBuilder
->expects($this->once())
->method('setTimeout')
->with($this->equalTo(0.0))
;

$fsMount->mounted('/mnt/point');
}
Expand Down Expand Up @@ -121,6 +131,12 @@ public function testMountWhenProcessFailsWillThrowException()
->method('setArguments')
->with($this->equalTo(array('mount', '/mnt/point')))
;
$this
->processBuilder
->expects($this->once())
->method('setTimeout')
->with($this->equalTo(0.0))
;

$fsMount->mount('/mnt/point');
}
Expand Down Expand Up @@ -175,6 +191,12 @@ public function testUmountWhenProcessFailsWillThrowException()
->method('setArguments')
->with($this->equalTo(array('umount', '/mnt/point')))
;
$this
->processBuilder
->expects($this->once())
->method('setTimeout')
->with($this->equalTo(0.0))
;

$fsMount->umount('/mnt/point');
}
Expand Down

0 comments on commit 5b8dcf5

Please sign in to comment.