Skip to content

test: flaky session-expiration-redirect.spec - #41018

Merged
ggazzo merged 2 commits into
developfrom
test/flakyExpiration
Jun 22, 2026
Merged

test: flaky session-expiration-redirect.spec#41018
ggazzo merged 2 commits into
developfrom
test/flakyExpiration

Conversation

@gabriellsh

@gabriellsh gabriellsh commented Jun 19, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

There was no assertion waiting for the room to load, so before the app would finish making all requests, the tokens would be removed from the database, causing remaining requests to redirect the user to the login page before the message search button could be clicked.

Issue(s)

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • Tests
    • Enhanced session expiration redirect testing with improved setup procedures, refined user targeting logic, optimized navigation patterns, and streamlined assertion mechanisms to increase test reliability and maintainability.

Task: FLAKY-2127

@gabriellsh
gabriellsh requested a review from a team as a code owner June 19, 2026 18:08
@dionisio-bot

dionisio-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 8.7.0, but it targets 8.6.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@gabriellsh gabriellsh added this to the 8.6.0 milestone Jun 19, 2026
@changeset-bot

changeset-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c5a03c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The session-expiration-redirect E2E spec removes restoreState from the fixture import, switches channel creation to use Users.user1.data.username, adds poHomeChannel.gotoChannel in beforeEach, drops the restoreState call from afterEach, and simplifies both login form redirect assertions to direct toBeVisible() calls.

Changes

Session Expiration Redirect E2E Test

Layer / File(s) Summary
Test setup, lifecycle, and redirect assertions
apps/meteor/tests/e2e/session-expiration-redirect.spec.ts
Removes restoreState from the userStates import, changes channel creation member to Users.user1.data.username, adds poHomeChannel.gotoChannel(targetChannel) to beforeEach, removes restoreState from afterEach, and replaces waitFor-with-timeout redirect checks with direct expect(...).toBeVisible() assertions for the Login form in both test cases.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • RocketChat/Rocket.Chat#40849: Directly targets the same expired-session redirect E2E test file and token-expiration behavior that this PR adjusts.

Suggested labels

type: chore

Suggested reviewers

  • ggazzo
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title directly and clearly describes the main objective: fixing flakiness in the session-expiration-redirect.spec test file, which aligns with the changeset's purpose of addressing race conditions and test reliability issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/meteor/tests/e2e/session-expiration-redirect.spec.ts
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.12%. Comparing base (fa685d0) to head (cd067e2).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41018      +/-   ##
===========================================
+ Coverage    70.11%   70.12%   +0.01%     
===========================================
  Files         3359     3359              
  Lines       129609   129609              
  Branches     22464    22434      -30     
===========================================
+ Hits         90878    90891      +13     
+ Misses       35422    35406      -16     
- Partials      3309     3312       +3     
Flag Coverage Δ
e2e 59.30% <ø> (-0.03%) ⬇️
e2e-api 47.07% <ø> (+0.86%) ⬆️
unit 70.04% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gabriellsh

Copy link
Copy Markdown
Member Author

/jira FLAKY

@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Jun 22, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 22, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jun 22, 2026
@jessicaschelly jessicaschelly removed the stat: QA assured Means it has been tested and approved by a company insider label Jun 22, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jun 22, 2026
@jessicaschelly
jessicaschelly removed this pull request from the merge queue due to a manual request Jun 22, 2026
@ggazzo ggazzo modified the milestones: 8.6.0, 8.7.0 Jun 22, 2026
@ggazzo
ggazzo merged commit 855c5c2 into develop Jun 22, 2026
81 of 85 checks passed
@ggazzo
ggazzo deleted the test/flakyExpiration branch June 22, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants