Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Improve docker start time #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions test/docker_start.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@ test('starting docker network..', (t) => {
exec(`docker-compose -p test -f ${__dirname}/docker-compose-testbed.yaml up -d`, (err, stdout, stderr) => {
if (-1 != stderr.indexOf('is up-to-date')) return t.end() ;
console.log('docker network started, giving extra time for freeswitch to initialize...');
setTimeout(() => {
let retries = 30;
const interval = setInterval(() => {
exec('docker exec freeswitch fs_cli -x "console loglevel debug"', (err, stdout, stderr) => {
t.end(err) ;
if (err) {
if (--retries > 0) return ;
clearInterval(interval) ;
return t.end(err) ;
}
clearInterval(interval);
t.end() ;
});
}, 18000);
}, 1000);
});
});