Skip to content

[3.0]test: Improve failing tests on layouts and recording - #25931

Merged
antobinary merged 2 commits into
bigbluebutton:v3.0.x-developfrom
antobinary:30-tests-improv
Oct 2, 2026
Merged

antobinary merged 2 commits into
bigbluebutton:v3.0.x-developfrom
antobinary:30-tests-improv

Conversation

@antobinary

Copy link
Copy Markdown
Member

What does this PR do?

Fixes the cause of three flaky Playwright tests on 3.0 CI and stabilizes two recording player tests. Seen on the run for #25917, where none of the failures were related to that PR.

1. fix(layout): apply the meeting layout reliably when a user joins

A user joining a meeting created with meetingLayout=CAMERAS_ONLY, MEDIA_ONLY, PRESENTATION_FOCUS, ... was sometimes left on the default custom layout, with the sidebar, chat and whiteboard visible in a layout that should hide them.

PushLayoutEngine stored the resolved layout by mutating Settings.application in place. That does not notify the reactive variable behind useSettings, so LayoutObserver only applied the layout if it happened to render again afterwards. The layout stored on the server was correct every time; only the joining client was wrong.

The fix assigns a new application object through the setter. The resolved value is unchanged.

This is what made these tests fail or flake, and they are not modified:

  • Create Parameters > Meeting Layout(default) > CAMERAS_ONLY
  • Create Parameters > Meeting Layout(default) > MEDIA_ONLY
  • Create Parameters > Enforce Layout > CUSTOM_LAYOUT

4.0 no longer has this code (it applies the layout through useLayoutUpdater).

2. test(recording): stop reading the player's progress bar too early

Recording > Player > Play/Pause failed with "progress bar width should not change when playback is paused" (439 px, then 447 px). The player repaints the play progress a few frames after the state it reflects has changed, and the test took its reference width in that window.

  • Play/Pause now checks the pause on the media element (paused, and currentTime unchanged after the wait) and takes the reference width once two consecutive readings agree.
  • Seek forward and backward polls for the expected width instead of sleeping 500 ms.

How was it tested?

Stock 3.0 container, client built from this branch and from v3.0.x-develop.

Check v3.0.x-develop This branch
Attendee on the wrong layout, 20 joins each for CAMERAS_ONLY and MEDIA_ONLY 8 of 40 0 of 40
Meeting Layout(default) and Enforce Layout, 16 tests x3, no retries not run 48 of 48 PASS
Recording > Player, 2 tests x12, no retries not run 24 of 24 PASS
CI-tagged recording/, layouts/, parameters/ (123 tests) not run 119 PASS, 2 skipped, 2 not passing (below)

The two that did not pass in the 123-test run:

  • Seek forward and backward flaked once; that is what the second commit fixes.
  • Hide Presentation On Join > After Uploading large presentation fails locally on v3.0.x-develop as well (3 of 3 on both builds), so it is not caused by this change.

The original Play/Pause failure did not reproduce locally; the late repaint was observed by sampling the page right after the pause (bar grew 5 px about 40 ms later in 2 of 6 runs while the media element was already paused).

A user joining a meeting created with meetingLayout=CAMERAS_ONLY,
MEDIA_ONLY, PRESENTATION_FOCUS, ... was sometimes left on the default
custom layout: sidebar, chat and whiteboard visible in a layout that is
supposed to hide them. The server side was right every time (the layout
row held the requested type and was never overwritten); only the joining
client was wrong, and it stayed wrong until something unrelated made the
layout observer render again.

PushLayoutEngine resolved the layout to start with and stored it by
mutating Settings.application in place. That changes the value without
notifying the reactive variable behind useSettings, so LayoutObserver,
which turns selectedLayout into the layout context's layoutType, only
picked it up if it happened to render again afterwards. Whether it did
depended on how the meeting subscription and the rest of the start-up
data interleaved. Components that read the Settings singleton directly
while rendering (nav bar, actions bar) did see the new value, which is
why the broken state had the hidden-layout nav bar on top of the custom
layout.

Assign a new application object through the setter instead, which
notifies the subscribers. The resolved value is the same as before.

Measured on a stock 3.0 container, two users, layout checked 3 s after
the second one joined, 20 joins per layout:

  v3.0.x-develop   CAMERAS_ONLY 4/20 wrong, MEDIA_ONLY 4/20 wrong
  with this change CAMERAS_ONLY 0/20 wrong, MEDIA_ONLY 0/20 wrong

This is what made "Meeting Layout(default) > CAMERAS_ONLY / MEDIA_ONLY"
and "Enforce Layout > CUSTOM_LAYOUT" in parameters.spec.ts fail or flake
in CI (e.g. the run for bigbluebutton#25917); the tests themselves are unchanged.

4.0 no longer has this code: it applies the layout through
useLayoutUpdater, which dispatches the layout type itself.
"Recording > Player > Play/Pause" failed in CI with "progress bar width
should not change when playback is paused" (439 px, then 447 px), on the
first attempt and on the retry.

The player repaints the play progress from its time updates, so the bar
is still catching up for a few frames after the state it reflects has
changed. Sampling the page right after a pause was acknowledged showed
the media element paused with a constant currentTime while the bar grew
by 5 px some 40 ms later, in 2 of 6 runs. The test took its reference
width in that window whenever the runner was slow enough.

Play/Pause: check the pause on the media element itself (paused, and
currentTime unchanged after the wait), and take the reference width only
once two consecutive readings agree. A playback that keeps running still
fails: on the paused flag, on currentTime, or because the width never
settles.

Seek forward and backward: the same lag behind a fixed 500 ms sleep. A
local run read 7.85% (the position before the seek) while the player
already showed 0:00 remaining. Poll for the expected width instead.
@antobinary antobinary added this to the Release 3.0 milestone Oct 2, 2026
@antobinary
antobinary requested a review from ramonlsouza October 2, 2026 13:43
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: fb21c0c2-90a4-4a9b-a300-a8bda33f8602

📥 Commits

Reviewing files that changed from the base of the PR and between 5a5769f and 4c86761.

📒 Files selected for processing (3)
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-tests/playwright/recording/recording.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

PushLayoutEngine now resolves the selected layout, converts custom to smart on mobile, and assigns the result through a copied Settings.application object. Playwright recording checks now verify paused playback time and progress stability. Seek-forward and seek-backward checks poll for the expected progress-bar state.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4c867

The available CI report records a Player test failure but does not show that this change caused it. No verified PR-introduced regression remains to block merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 4c867

The fix preserves layout-selection rules and existing presenter checks. More reliable updates can also activate existing meeting-wide synchronization. No security regression was established, but failure and recovery behavior for that synchronization was not fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The identified production effect extends from local layout settings to conditional existing meeting-layout synchronization. The changed recording helpers are exercised by test callers, not newly exposed production endpoints.

Trust Boundaries and Controls

  • observed — Client propagation requires presenter status, enabled push layout and propagatable elements. The server action is configured for the bbb_client role through the existing action adapter; this configuration alone does not establish server-side presenter authorization.

Resilience and Maintainability Implications

  • inferred — Publication alone does not retrigger the initialization effect, whose dependencies are meeting-layout availability and enforced layout. Previous-value tracking and value-based propagation checks limit repeated writes once relevant values settle; they do not prove asynchronous failure or recovery behavior.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: improving flaky layout and recording tests.
Description check ✅ Passed The description directly explains the layout fix, recording test stabilization, testing results, and known unrelated failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit 7afde49 into bigbluebutton:v3.0.x-develop Oct 2, 2026
33 checks passed
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