fix(dev-infra): await setup in runBenchmark (#37428)

* Fix for issue #36986.
* Changes runBenchmark into an async function.
* Awaits config.setup in runBenchmark.

PR Close #37428
This commit is contained in:
Wagner Maciel 2020-06-03 16:39:01 -07:00 committed by atscott
parent d887ba85ad
commit 77efddcac3
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ const globalOptions = {
const runner = createBenchpressRunner(); const runner = createBenchpressRunner();
export function runBenchmark(config: { export async function runBenchmark(config: {
id: string, id: string,
url: string, url: string,
params: {name: string, value: any}[], params: {name: string, value: any}[],
@ -34,7 +34,7 @@ export function runBenchmark(config: {
}): Promise<any> { }): Promise<any> {
openBrowser(config); openBrowser(config);
if (config.setup) { if (config.setup) {
config.setup(); await config.setup();
} }
const description: {[key: string]: any} = {}; const description: {[key: string]: any} = {};
config.params.forEach((param) => description[param.name] = param.value); config.params.forEach((param) => description[param.name] = param.value);