volumes: only wait for 5 seconds for mount status
mountpoint -q can never exit if the nfs mount disappears, for example
This commit is contained in:
@@ -52,27 +52,32 @@ describe('shell', function () {
|
||||
await safe(shell.promises.sudo('test', [ RELOAD_NGINX_CMD, 'nginx' ], {}));
|
||||
});
|
||||
|
||||
it('execSync a valid shell program', function (done) {
|
||||
it('exec a valid shell program', function (done) {
|
||||
shell.exec('test', 'ls -l | wc -c', {}, function (error) {
|
||||
done(error);
|
||||
});
|
||||
});
|
||||
|
||||
it('execSync a valid shell program (promises)', async function () {
|
||||
it('exec a valid shell program (promises)', async function () {
|
||||
await shell.promises.exec('test', 'ls -l | wc -c', {});
|
||||
});
|
||||
|
||||
it('execSync throws for invalid program', function (done) {
|
||||
it('exec throws for invalid program', function (done) {
|
||||
shell.exec('test', 'cannotexist', {}, function (error) {
|
||||
expect(error).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('execSync throws for failed program', function (done) {
|
||||
it('exec throws for failed program', function (done) {
|
||||
shell.exec('test', 'false', {}, function (error) {
|
||||
expect(error).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('exec times out properly', async function () {
|
||||
const [error] = await safe(shell.promises.exec('sleeping', 'sleep 20', { timeout: 1000 }));
|
||||
expect(error.signal).to.be('SIGTERM'); // somtimes code is ETIMEOUT
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user