Skip to content

Fix intermittent metrics e2e test failure#9980

Merged
Gudahtt merged 1 commit intodevelopfrom
fix-intermittent-metrics-e2e-test-failure
Dec 3, 2020
Merged

Fix intermittent metrics e2e test failure#9980
Gudahtt merged 1 commit intodevelopfrom
fix-intermittent-metrics-e2e-test-failure

Conversation

@Gudahtt
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt commented Dec 3, 2020

The metrics e2e test would fail if the segment events still weren't dispatched when the page loaded. The Segment events are sent on a set interval, so it isn't abnormal for them to lag behind the page load itself. The waitUntilCalled utility has been used to wait until all required events have been dispatched.

The wait-until-called module was converted to an ES5 module, so that it could be used from an e2e test. The optional callCount parameter has also been added, to allow waiting for more than one call.

The segmentSpy had to be converted to a segmentStub, to allow the waitUntilCalled utility to be used.

@Gudahtt
Copy link
Copy Markdown
Member Author

Gudahtt commented Dec 3, 2020

This depends upon #9979

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7a42dd0]
Page Load Metrics (323 ± 33 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint296445157
domContentLoaded2634683226833
load2644713236833
domInteractive2624673216833

@rekmarks rekmarks self-requested a review December 3, 2020 17:30
Base automatically changed from move-initial-e2e-navigation-into-tests to develop December 3, 2020 17:30
The metrics e2e test would fail if the segment events still weren't
dispatched when the page loaded. The Segment events are sent on a set
interval, so it isn't abnormal for them to lag behind the page load
itself. The `waitUntilCalled` utility has been used to wait until all
required events have been dispatched.

The `wait-until-called` module was converted to an ES5 module, so that
it could be used from an e2e test. The optional `callCount` parameter
has also been added, to allow waiting for more than one call.

The `segmentSpy` had to be converted to a `segmentStub`, to allow the
`waitUntilCalled` utility to be used.
@Gudahtt Gudahtt force-pushed the fix-intermittent-metrics-e2e-test-failure branch from 7a42dd0 to 36a7d78 Compare December 3, 2020 17:31
@Gudahtt Gudahtt marked this pull request as ready for review December 3, 2020 17:31
@Gudahtt Gudahtt requested a review from a team as a code owner December 3, 2020 17:31
Copy link
Copy Markdown
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [36a7d78]
Page Load Metrics (380 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint298053189
domContentLoaded2835483788641
load2845503808641
domInteractive2835473788641

@Gudahtt Gudahtt merged commit b1b6d7a into develop Dec 3, 2020
@Gudahtt Gudahtt deleted the fix-intermittent-metrics-e2e-test-failure branch December 3, 2020 18:00
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants