Skip to content

Randomize user_id in session collapse tests - #3624

Closed
aerosol wants to merge 1 commit into
masterfrom
random-session-ids-for-session-collapse-test
Closed

aerosol wants to merge 1 commit into
masterfrom
random-session-ids-for-session-collapse-test

Conversation

@aerosol

@aerosol aerosol commented Dec 13, 2023

Copy link
Copy Markdown
Member

Changes

This is a blind stab at https://github.com/plausible/analytics/actions/runs/7192271123/job/19588394230 introduced via #3622 - to prevent Cachex lookups clash.

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

Documentation

  • Docs have been updated
  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode
  • This PR does not change the UI

@aerosol
aerosol requested a review from ruslandoga December 13, 2023 08:31
e =
build(:event,
name: "pageview",
user_id: random_user_id()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

eh, this is factory-provided

@aerosol

aerosol commented Dec 13, 2023

Copy link
Copy Markdown
Member Author

invalid, events have user_id based on UUID already

@aerosol aerosol closed this Dec 13, 2023
@aerosol

aerosol commented Dec 13, 2023

Copy link
Copy Markdown
Member Author

@ruslandoga I'm thinking that maybe site_id: Enum.random(1000..10_000), in event_factory is not enough for this to be reliable, but on the other hand that kind of error should be reproducible with --seed 🤔

@ruslandoga

ruslandoga commented Dec 13, 2023 •

Copy link
Copy Markdown
Contributor

Ah, I assumed build(:event)'s site_ids point to real site ids in PostgreSQL. I'll update the "collapse order" tests to create real sites and use their ids. Enum.random(1000..10_000) might be replaced with System.unique_integer([:positive])

@aerosol

aerosol commented Dec 13, 2023

Copy link
Copy Markdown
Member Author

@ruslandoga I have a repro, hold on, inserting site IDs doesn't guarantee in-cache uniqueness

@aerosol

aerosol commented Dec 13, 2023

Copy link
Copy Markdown
Member Author

@aerosol
aerosol deleted the random-session-ids-for-session-collapse-test branch December 13, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants