kibana/test/functional/services/remote/browser_driver_api/ping.js
John Dorlus a31ec148f4
Adding firefox to test suite (#17195)
* Created general driver to accept an argument select the driver to run.

* Added environment variable for driver, changed package.json to use custim leadfoot, and made changes to browserdriver to use any driver.

* Made changes per PR.

* Fixed all nits.
2018-03-16 23:05:10 -04:00

16 lines
357 B
JavaScript

import request from 'request';
import { fromNode as fcb } from 'bluebird';
export async function ping(url) {
try {
await Promise.race([
fcb(cb => request(url, cb)),
new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('timeout')), 1000);
})
]);
return true;
} catch (err) {
return false;
}
}