fix(benchpress): work around missing events from Chrome 63 (#21396)

Chrome 63 can cause the navigationStart event for the first
run to arrive with a different pid than the start of the
benchpress run. This makes the first collected result invalid.

This workaround causes the sampler to ignore runs that have this
condition.

PR Close #21396
This commit is contained in:
Alex Rickabaugh
2018-01-08 11:22:15 -08:00
committed by Kara Erickson
parent 27196b676b
commit fa03ae14b0
3 changed files with 27 additions and 1 deletions

View File

@ -537,6 +537,24 @@ import {TraceEventFactory} from '../trace_event_factory';
});
}));
it('should mark a run as invalid if the start and end marks are different',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
const otherProcessEventFactory = new TraceEventFactory('timeline', 'pid1');
const metric = createMetric(
[[
eventFactory.markStart('benchpress0', 0), eventFactory.start('script', 0, null),
eventFactory.end('script', 5, null),
otherProcessEventFactory.start('script', 10, null),
otherProcessEventFactory.end('script', 17, null),
otherProcessEventFactory.markEnd('benchpress0', 20)
]],
null !);
metric.beginMeasure().then((_) => metric.endMeasure(false)).then((data) => {
expect(data['invalid']).toBe(1);
async.done();
});
}));
it('should support scriptTime metric',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
aggregate([