Skip to content

Commit 400bfe6

Browse files
committed
ping imagetest after having restarting nw.js
- should fix some intermittent hangups when running the image tests locally
1 parent e5c860a commit 400bfe6

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

tasks/baseline.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ var cmd = containerCommands.getRunCmd(
1414
);
1515

1616
console.log(msg);
17-
common.execCmd(containerCommands.ping, function() {
18-
common.execCmd(cmd);
19-
});
17+
common.execCmd(cmd);

tasks/test_export.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ var cmd = containerCommands.getRunCmd(
1414
);
1515

1616
console.log(msg);
17-
common.execCmd(containerCommands.ping, function() {
18-
common.execCmd(cmd);
19-
});
17+
common.execCmd(cmd);

tasks/test_image.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ var cmd = containerCommands.getRunCmd(
1414
);
1515

1616
console.log(msg);
17-
common.execCmd(containerCommands.ping, function() {
18-
common.execCmd(cmd);
19-
});
17+
common.execCmd(cmd);

tasks/util/container_commands.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ containerCommands.setup = [
2121
containerCommands.cpIndex,
2222
containerCommands.injectEnv,
2323
containerCommands.restart,
24-
'sleep 1',
24+
containerCommands.ping,
25+
'sleep 5'
2526
].join(' && ');
2627

2728
containerCommands.dockerRun = [
@@ -34,12 +35,17 @@ containerCommands.dockerRun = [
3435

3536
containerCommands.getRunCmd = function(isCI, commands) {
3637
var _commands = Array.isArray(commands) ? commands.slice() : [commands];
38+
var cmd;
3739

38-
if(isCI) return getRunCI(_commands);
40+
if(isCI) {
41+
_commands = [containerCommands.ping].concat(_commands);
42+
cmd = getRunCI(_commands);
43+
} else {
44+
_commands = [containerCommands.setup].concat(_commands);
45+
cmd = getRunLocal(_commands);
46+
}
3947

40-
// add setup commands locally
41-
_commands = [containerCommands.setup].concat(_commands);
42-
return getRunLocal(_commands);
48+
return cmd;
4349
};
4450

4551
function getRunLocal(commands) {

0 commit comments

Comments
 (0)