fix(benchpress): Fix promise chain in chrome_driver_extension. (#23458)
Occasionally the promise to clear the chrome buffer resolves after the subsequent call to start the timer. This problem causes flakiness in our tests that rely on benchpress, usually manifesting itself as a "Tried too often to get the ending mark: 21" error thrown by this line: https://github.com/angular/angular/blob/master/packages/benchpress/src/metric/perflog_metric.ts#L162 PR Close #23458
This commit is contained in:
parent
66b2d78305
commit
d4b6c41a5f
|
@ -51,12 +51,12 @@ export class ChromeDriverExtension extends WebDriverExtension {
|
|||
|
||||
gc() { return this._driver.executeScript('window.gc()'); }
|
||||
|
||||
timeBegin(name: string): Promise<any> {
|
||||
async timeBegin(name: string): Promise<any> {
|
||||
if (this._firstRun) {
|
||||
this._firstRun = false;
|
||||
// Before the first run, read out the existing performance logs
|
||||
// so that the chrome buffer does not fill up.
|
||||
this._driver.logs('performance');
|
||||
await this._driver.logs('performance');
|
||||
}
|
||||
return this._driver.executeScript(`console.time('${name}');`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue