Repository navigation
add session collapse order test - #3622
Merged
Merged
Conversation
11 of 13 tasks
ruslandoga
force-pushed
the
session-insert-order-test
branch
7 times, most recently
from
December 13, 2023 06:09
e61f7bf to
a1f96ac
Compare
ruslandoga
force-pushed
the
session-insert-order-test
branch
from
December 13, 2023 06:15
a1f96ac to
5a044a6
Compare
ruslandoga
commented
Dec 13, 2023
| assert session.exit_page == "/exit" | ||
| end | ||
|
|
||
| test "within parts" do |
Contributor
Author
There was a problem hiding this comment.
within parts test is not strictly required since ClickHouse is smart enough to fix the ordering within a single part but I'm including it for completeness.
ruslandoga
commented
Dec 13, 2023
| assert session.duration == 10 | ||
| end | ||
|
|
||
| describe "collapse order" do |
Contributor
Author
There was a problem hiding this comment.
To make the tests fail, reverse the order in Plausible.Session.CacheStore.on_event
- buffer.insert([%{updated_session | sign: 1}, %{found_session | sign: -1}])
+ buffer.insert([%{found_session | sign: -1}, %{updated_session | sign: 1}])
4 tasks done
ukutaht
approved these changes
Dec 13, 2023
aerosol
approved these changes
Dec 13, 2023
Member
|
The test seems flaky: https://github.com/plausible/analytics/actions/runs/7192271123/job/19588394230 |
aerosol
reviewed
Dec 13, 2023
|
|
||
| describe "collapse order" do | ||
| defp flush(events) do | ||
| for e <- events, do: CacheStore.on_event(e, nil) |
Member
There was a problem hiding this comment.
maybe a separate buffer must be spawned for each test?
Contributor
Author
There was a problem hiding this comment.
The problem doesn't seem to be with the buffer, but rather with the site_ids which are not unique. I'll need to check how they are generated.
4 of 8 tasks
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
This PR adds tests to ensure the correct session collapse order. It should prevent issues similar to #3511 (comment)
Tests
Changelog
Documentation
Dark mode