Alter a couple E2E exploration test so that they don't fail on evening UTC#6400
Merged
Conversation
aerosol
approved these changes
May 26, 2026
114b476 to
9eddb5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
While this change makes the tests not fail at least now, it's not ideal. It's also not really a fix but rather a cover up of a certain behavior of FE logic building the initial DashboardState object.
The default period of the query is determined when building dashboard state context in https://github.com/plausible/analytics/blob/e2e-exploration-failing-tests-time/assets/js/dashboard/dashboard-state-context.tsx#L71-L77.
If the current time falls into today or yesterday, a
dayperiod is chosen: https://github.com/plausible/analytics/blob/e2e-exploration-failing-tests-time/assets/js/dashboard/dashboard-time-periods.ts#L637-L639Even if the native stats start date falls on yesterday, the default day is always picked as today in https://github.com/plausible/analytics/blob/e2e-exploration-failing-tests-time/assets/js/dashboard/dashboard-state-context.tsx#L98
It means that for stats which a) started collecting yesterday b) don't have any events for today (yet), the dashboard will turn up initially empty. I suppose it's a reasonable compromise but also something that can trip us up when building synthethic test cases via methods like populate_stats.
For now this should do well enough, however, the tests relying on stats setups shifted minutes in the past might fail shortly after midnight UTC. For better robustness, we'd probably have to ensure that the most suitable period is always set manually as part of the test setup. We might circle back to that further robustness refinement later on.