Skip to content

Add more session events metrics e2e tests#13404

Merged
vdonato merged 2 commits intodevelopfrom
vdonato/more-ws-metrics-tests
Dec 18, 2025
Merged

Add more session events metrics e2e tests#13404
vdonato merged 2 commits intodevelopfrom
vdonato/more-ws-metrics-tests

Conversation

@vdonato
Copy link
Copy Markdown
Collaborator

@vdonato vdonato commented Dec 18, 2025

Describe your changes

In #13324, we added e2e tests to validate that session event metrics were being served but didn't add
tests on the metrics behavior itself because:

  • there's already decent test coverage around this in websocket session manager unit tests.
  • that PR was already getting much longer than initially expected.

This PR goes back to add Playwright tests to validate that session event counter metrics increase
when we expect them to.

Copilot AI review requested due to automatic review settings December 18, 2025 00:30
@vdonato vdonato added security-assessment-completed change:other PR contains other type of change impact:internal PR changes only affect internal code labels Dec 18, 2025
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Dec 18, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 18, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13404/streamlit-1.52.1-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13404.streamlit.app (☁️ Deploy here if not accessible)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds e2e tests to validate session event metrics behavior when websocket connections are interrupted and reconnected. It extends the testing coverage from #13324 by adding tests that verify metrics counters increase correctly.

Key Changes

  • Added a helper function _get_session_event_counts() to fetch and parse session event metrics from the metrics endpoint
  • Added test to verify metrics increase on a single disconnect/reconnect cycle
  • Added test to verify metrics accumulate correctly over multiple disconnect/reconnect cycles

@lukasmasuch lukasmasuch added the flaky-verify If applied to PR will run flaky test verification workflow label Dec 18, 2025
@lukasmasuch
Copy link
Copy Markdown
Collaborator

@cursor review

@github-actions github-actions bot removed the flaky-verify If applied to PR will run flaky test verification workflow label Dec 18, 2025
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@vdonato vdonato enabled auto-merge (squash) December 18, 2025 20:04
@vdonato vdonato merged commit 9d28a7d into develop Dec 18, 2025
42 checks passed
@vdonato vdonato deleted the vdonato/more-ws-metrics-tests branch December 18, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:other PR contains other type of change impact:internal PR changes only affect internal code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants