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:
parent
d887ba85ad
commit
77efddcac3
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue