Skip to content

Commit a0ffee8

Browse files
committed
Merge pull request #72 from browserstack/bug_fixes
Bug fixes
2 parents ed31bd4 + 8f51ec2 commit a0ffee8

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

bin/cli.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ if (process.argv[2] == '--verbose')
55
else
66
global.logLevel = "info";
77

8+
if (process.argv[2] == 'init') {
9+
require('./init.js');
10+
return;
11+
}
12+
813
var Log = require('../lib/logger'),
914
logger = new Log(global.logLevel),
1015
BrowserStack = require('browserstack'),
@@ -30,6 +35,7 @@ function terminateAllWorkers(callback) {
3035
if(worker) {
3136
logger.debug('[%s] Terminated', worker.string);
3237
clearTimeout(worker.activityTimeout);
38+
clearTimeout(worker.testActivityTimeout);
3339
delete workers[key];
3440
delete workerKeys[worker.id];
3541
}
@@ -215,7 +221,7 @@ var statusPoller = {
215221
}
216222
}, activityTimeout * 1000);
217223

218-
setTimeout(function () {
224+
worker.testActivityTimeout = setTimeout(function () {
219225
if (worker.acknowledged) {
220226
var subject = "Tests timed out on: " + worker.string;
221227
var content = "Worker details:\n" + JSON.stringify(worker.config, null, 4);
@@ -275,21 +281,16 @@ function runTests() {
275281
}
276282

277283
try {
278-
if (process.argv[2] == 'init') {
279-
require('./init.js');
280-
} else {
281-
var client = BrowserStack.createClient({
282-
username: config.username,
283-
password: config.key
284-
});
285-
runTests();
286-
var pid_file = process.cwd() + '/browserstack-run.pid';
287-
fs.writeFileSync(pid_file, process.pid, 'utf-8')
288-
process.on('SIGINT', function() { cleanUpAndExit('SIGINT', 1) });
289-
process.on('SIGTERM', function() { cleanUpAndExit('SIGTERM', config.status) });
290-
}
284+
var client = BrowserStack.createClient({
285+
username: config.username,
286+
password: config.key
287+
});
288+
runTests();
289+
var pid_file = process.cwd() + '/browserstack-run.pid';
290+
fs.writeFileSync(pid_file, process.pid, 'utf-8')
291+
process.on('SIGINT', function() { cleanUpAndExit('SIGINT', 1) });
292+
process.on('SIGTERM', function() { cleanUpAndExit('SIGTERM', config.status) });
291293
} catch (e) {
292294
console.log(e);
293295
console.log('Invalid command.');
294296
}
295-

lib/server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ exports.Server = function Server(bsClient, workers) {
198198
logger.debug('[%s] Terminated', getTestBrowserInfo(worker));
199199

200200
clearTimeout(workers[uuid].activityTimeout);
201+
clearTimeout(workers[uuid].testActivityTimeout);
201202
delete workers[uuid];
202203

203204
if (utils.objectSize(workers) === 0) {

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var uuid = function uuidGenerator() {
2626
};
2727

2828
var browserString = function browserString(config) {
29-
return config.os + ' ' + config.os_version + ', ' + titleCase(config.browser || config.device) + ' ' + (config.browser_version || config.device);
29+
return config.os + ' ' + config.os_version + ', ' + (config.browser == 'ie' ? 'IE' : titleCase(config.browser || config.device)) + ' ' + (config.browser_version || config.device);
3030
};
3131

3232
var objectSize = function objectSize(obj) {

0 commit comments

Comments
 (0)