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:
Girish Ramakrishnan
2024-02-20 21:38:54 +01:00
parent 26eb739b46
commit 3da3ccedcb
3 changed files with 13 additions and 6 deletions
+9 -4
View File
@@ -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
});
});