Skip to content

test(recording): stop reading the player's progress bar too early - #26088

Merged
ramonlsouza merged 1 commit into
bigbluebutton:v4.0.x-developfrom
antobinary:port-25931-recording-play-pause-40
Oct 20, 2026
Merged

ramonlsouza merged 1 commit into
bigbluebutton:v4.0.x-developfrom
antobinary:port-25931-recording-play-pause-40

Conversation

@antobinary

Copy link
Copy Markdown
Member

Ports parts of #25931 to BBB 4.0+

What does this PR do?

It forward-ports the test fix of #25931 to 4.0, so that Recording > Player > Play/Pause stops failing at random. The commit is cherry-picked unchanged from 3.0 (4c86761).

  • Play/Pause: the test now checks that the media element itself is paused, and that its currentTime has not moved after the wait. It takes the reference width of the progress bar only once two readings 250 ms apart 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 test polls for the expected width instead of sleeping a fixed 500 ms.

The other commit of #25931 (fix(layout): apply the meeting layout reliably when a user joins) is not ported. The code it fixed, an in-place change of Settings.application in pushLayoutEngine.jsx, is not on 4.0, where the layout is applied through useLayoutUpdater.

Motivation

Recording > Player > Play/Pause fails now and then in 4.0 CI. On PR #26085 (run 38889384779) it failed on both attempts: the bar measured 416 px right after the pause and 423 px two seconds later (420 and 428 px on the retry).

The player does pause at once; its currentTime stops. But video.js draws the progress bar at its final width one or two frames later, about 30 ms after the pause event. The test reads the width 13 to 19 ms after its pause click, according to the CI traces, so the read can land before that last update. 3.0 had the same failure until #25931.

How to test

npx playwright test recording/recording.spec.ts -g "Player"

Results on a 4.0 dev container (bbb-playback v5.4.7, which has the same video.js 7.21.4 as v5.4.8):

v4.0.x-develop this PR
Play/Pause, spec repeated 20 of 20 passed; 20 of 20 with the test process limited to half a CPU core 20 of 20 passed
Seek forward and backward, spec repeated — 10 of 10 passed
Same pause, both checks, on the real player (48 pauses) the current check failed on 3 (202 to 205, 202 to 205, 201 to 204 px) the ported check passed all 48

The failure is timing-dependent, and like on 3.0 the spec did not fail locally without this PR either. So I also applied both checks to the same pauses, using a script that repeats the test's steps on the real player. On the 3 pauses where the current check failed, the ported check waited for the bar to settle and passed. In all 48 pauses the media was paused and currentTime did not move.

"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.

(cherry picked from commit 4c86761)
@antobinary antobinary added this to the Release 4.0 milestone Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 09fb8243-fe5d-42e0-9cb1-3c5dca69ac72
📥 Commits

Reviewing files that changed from the base of the PR and between f16ae31 and e9bf014.

📒 Files selected for processing: 2
  • 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

The recording Playwright tests now check that playback time and progress-bar width remain unchanged while paused. The tests also poll for the expected progress-bar state after forward and backward seeks. A selector for the video.js media element supports the pause check.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: imdt-claudiop

Merge Risk: ⚪ Minimal · up to e9bf0

The change checks paused playback and waits for visible seek completion. No concrete current-head failure is established that would block merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing recording-player tests from reading the progress bar before it settles.
Description check Passed The description directly explains the test fix, its timing-related motivation, the affected Play/Pause and seek checks, and the reported validation results.
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 2…
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.
Full details: Docstring Coverage

Explanation

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 2 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copy link
Copy Markdown

✅ Automated tests have passed!

@ramonlsouza
ramonlsouza merged commit 74abc38 into bigbluebutton:v4.0.x-develop Oct 20, 2026
34 checks passed
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Oct 22, 2026
…s unique

The suite had 162 waitForTimeout calls in 40 files. A fixed sleep is too
long on a quiet server and can still be too short under CI load, so each
one was looked at: 46 now wait for what they were standing in for, and
the 116 left are either the duration the test is about (an observation
window for something that must not happen, a debounce, a sampling or
recording interval, reproduction pacing), or wait for server-side state
that the page does not show (a guest policy reaching bbb-web, notes or
annotations stored before an export). A few of the kept ones have no
stated purpose and are listed in the PR evidence rather than guessed at.
Some conversions were undone after they failed a repeated run, and the
pauses stay: the one between two rotate clicks also lets the server echo
of the first rotation arrive before the second (otherwise the echo can
overwrite it), the one before typing in the slide-change-while-editing
test is part of that reproduction's timing, and the one before the
layout screenshots that include the whiteboard lets the camera fit the
slide that has just been shown (under CI timing the screenshot otherwise
caught a stale zoom). None of these is visible on the page.

The largest savings:

- Smart Slides polls slept 5 s after the upload and again before opening
  the quick poll. What the quick poll needs is the presenter's toolbar to
  show the target slide: the slide selector and the quick-poll button are
  rendered from the same current-slide prop, so goToSlide() waits for the
  selector to show that slide. This also covers the stale-question race
  the 3 s wait in the typed-response test was guarding against.
- The camera re-sync tests slept 5 s after mount, after the shrink and
  after the expand. A probe of the camera, wrapper and slide sizes showed
  the camera re-fits about 0.9 s after a resize, and that the slide spans
  #presentationInnerWrapper exactly when the camera fits it (twice that
  when zoomed 2x, 1.5 times at 150%). waitForSlideScale() waits for that
  ratio in a wrapper of the new size and does not fail itself, so a
  camera that never re-syncs is still reported by the existing checks.
  The wait after restoring the minimized presentation is kept: the probe
  showed the restore passes through the fit zoom before the cached zoom
  comes back, so a poll there could pass before the regression shows.
  The mount waits also wait for the presentation layout through
  waitForPresentationLayout(), a local helper of whiteboardResize.ts
  that waits until the toolbar's height is reserved, because the
  viewer's wrapper width is compared for exact equality. The zoomed visual test
  now closes the toasts before its first screenshot, as its sibling
  already did: the 8 s of sleeps were what let the "left the audio
  conference" toast disappear before that screenshot.
- The late joiner of the external video test waited 10 s before looking
  for the video; it now waits up to the same total for the video itself.
- The learning dashboard reloaded after 10 s to see the meeting duration
  grow; it now reloads every second until it has.
- The clock-skew recording test waited 5 s for the RTT worker; it now
  waits for the /rtt-check response itself.
- Shared helpers: the presentation manager's list is waited for (the
  thumbnail of the shown or minimized presentation) instead of 500 ms in
  each upload, and the breakout panel waits for the attendee and the first
  room instead of 2 s before every breakout test drags the attendee.
- Some waits before screenshot comparisons now rely on
  prepareForScreenshot and the stable-frame check of toHaveScreenshot,
  which compares the first stable frame and does not retry after it, so
  each waits for what the frame needs first: the exported-presentation
  screenshots wait for the whiteboard to swap in the new slide (it does so
  only once the image is decoded), the cameras-only layout waits for both
  webcams, and the participants-and-chat layout has no presentation to
  settle. The screenshot of two freshly joined breakout rooms keeps its
  wait, since nothing marks the first slide of a fresh join as painted.

The recording tests' progress-bar waits were already polls on this
branch (bigbluebutton#26088), so that part is left as it is. The external video
late-joiner wait goes from a fixed ELEMENT_WAIT_LONGER_TIME to waiting
for the attendee's video frame, within the same YouTube-based helpers
the branch has today.

Six leaf titles repeated within a spec file, so -g and title-based lists
could not tell the tests apart. They now say what differs: the breakout
duration change in the creation form or of running rooms, the unified
layout minimize for a moderator without or in audio, and the four layout
tests named after the parameter they use (meetingLayout= or
enforceLayout=). No workflow, README, sdk-flaky-tests.txt or snapshot
name refers to the old titles; the four layout tests keep their
quarantine tag and issue link.
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Oct 22, 2026
…s unique

The suite had 162 waitForTimeout calls in 40 files. A fixed sleep is too
long on a quiet server and can still be too short under CI load, so each
one was looked at: 46 now wait for what they were standing in for, and
the 116 left are either the duration the test is about (an observation
window for something that must not happen, a debounce, a sampling or
recording interval, reproduction pacing), or wait for server-side state
that the page does not show (a guest policy reaching bbb-web, notes or
annotations stored before an export). A few of the kept ones have no
stated purpose and are listed in the PR evidence rather than guessed at.
Some conversions were undone after they failed a repeated run, and the
pauses stay: the one between two rotate clicks also lets the server echo
of the first rotation arrive before the second (otherwise the echo can
overwrite it), the one before typing in the slide-change-while-editing
test is part of that reproduction's timing, and the one before the
layout screenshots that include the whiteboard lets the camera fit the
slide that has just been shown (under CI timing the screenshot otherwise
caught a stale zoom). None of these is visible on the page.

The largest savings:

- Smart Slides polls slept 5 s after the upload and again before opening
  the quick poll. What the quick poll needs is the presenter's toolbar to
  show the target slide: the slide selector and the quick-poll button are
  rendered from the same current-slide prop, so goToSlide() waits for the
  selector to show that slide. This also covers the stale-question race
  the 3 s wait in the typed-response test was guarding against.
- The camera re-sync tests slept 5 s after mount, after the shrink and
  after the expand. A probe of the camera, wrapper and slide sizes showed
  the camera re-fits about 0.9 s after a resize, and that the slide spans
  #presentationInnerWrapper exactly when the camera fits it (twice that
  when zoomed 2x, 1.5 times at 150%). waitForSlideScale() waits for that
  ratio in a wrapper of the new size and does not fail itself, so a
  camera that never re-syncs is still reported by the existing checks.
  The wait after restoring the minimized presentation is kept: the probe
  showed the restore passes through the fit zoom before the cached zoom
  comes back, so a poll there could pass before the regression shows.
  The mount waits also wait for the presentation layout through
  waitForPresentationLayout(), a local helper of whiteboardResize.ts
  that waits until the toolbar's height is reserved, because the
  viewer's wrapper width is compared for exact equality. The zoomed visual test
  now closes the toasts before its first screenshot, as its sibling
  already did: the 8 s of sleeps were what let the "left the audio
  conference" toast disappear before that screenshot.
- The late joiner of the external video test waited 10 s before looking
  for the video; it now waits up to the same total for the video itself.
- The learning dashboard reloaded after 10 s to see the meeting duration
  grow; it now reloads every second until it has.
- The clock-skew recording test waited 5 s for the RTT worker; it now
  waits for the /rtt-check response itself.
- Shared helpers: the presentation manager's list is waited for (the
  thumbnail of the shown or minimized presentation) instead of 500 ms in
  each upload, and the breakout panel waits for the attendee and the first
  room instead of 2 s before every breakout test drags the attendee.
- Some waits before screenshot comparisons now rely on
  prepareForScreenshot and the stable-frame check of toHaveScreenshot,
  which compares the first stable frame and does not retry after it, so
  each waits for what the frame needs first: the exported-presentation
  screenshots wait for the whiteboard to swap in the new slide (it does so
  only once the image is decoded), the cameras-only layout waits for both
  webcams, and the participants-and-chat layout has no presentation to
  settle. The screenshot of two freshly joined breakout rooms keeps its
  wait, since nothing marks the first slide of a fresh join as painted.

The recording tests' progress-bar waits were already polls on this
branch (bigbluebutton#26088), so that part is left as it is. The external video
late-joiner wait goes from a fixed ELEMENT_WAIT_LONGER_TIME to waiting
for the attendee's video frame, within the same YouTube-based helpers
the branch has today.

Six leaf titles repeated within a spec file, so -g and title-based lists
could not tell the tests apart. They now say what differs: the breakout
duration change in the creation form or of running rooms, the unified
layout minimize for a moderator without or in audio, and the four layout
tests named after the parameter they use (meetingLayout= or
enforceLayout=). No workflow, README, sdk-flaky-tests.txt or snapshot
name refers to the old titles; the four layout tests keep their
quarantine tag and issue link.
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Oct 22, 2026
…s unique

The suite had 162 waitForTimeout calls in 40 files. A fixed sleep is too
long on a quiet server and can still be too short under CI load, so each
one was looked at: 46 now wait for what they were standing in for, and
the 116 left are either the duration the test is about (an observation
window for something that must not happen, a debounce, a sampling or
recording interval, reproduction pacing), or wait for server-side state
that the page does not show (a guest policy reaching bbb-web, notes or
annotations stored before an export). A few of the kept ones have no
stated purpose and are listed in the PR evidence rather than guessed at.
Some conversions were undone after they failed a repeated run, and the
pauses stay: the one between two rotate clicks also lets the server echo
of the first rotation arrive before the second (otherwise the echo can
overwrite it), the one before typing in the slide-change-while-editing
test is part of that reproduction's timing, and the one before the
layout screenshots that include the whiteboard lets the camera fit the
slide that has just been shown (under CI timing the screenshot otherwise
caught a stale zoom). None of these is visible on the page.

The largest savings:

- Smart Slides polls slept 5 s after the upload and again before opening
  the quick poll. What the quick poll needs is the presenter's toolbar to
  show the target slide: the slide selector and the quick-poll button are
  rendered from the same current-slide prop, so goToSlide() waits for the
  selector to show that slide. This also covers the stale-question race
  the 3 s wait in the typed-response test was guarding against.
- The camera re-sync tests slept 5 s after mount, after the shrink and
  after the expand. A probe of the camera, wrapper and slide sizes showed
  the camera re-fits about 0.9 s after a resize, and that the slide spans
  #presentationInnerWrapper exactly when the camera fits it (twice that
  when zoomed 2x, 1.5 times at 150%). waitForSlideScale() waits for that
  ratio in a wrapper of the new size and does not fail itself, so a
  camera that never re-syncs is still reported by the existing checks.
  The wait after restoring the minimized presentation is kept: the probe
  showed the restore passes through the fit zoom before the cached zoom
  comes back, so a poll there could pass before the regression shows.
  The mount waits also wait for the presentation layout through
  waitForPresentationLayout(), a local helper of whiteboardResize.ts
  that waits until the toolbar's height is reserved, because the
  viewer's wrapper width is compared for exact equality. The zoomed visual test
  now closes the toasts before its first screenshot, as its sibling
  already did: the 8 s of sleeps were what let the "left the audio
  conference" toast disappear before that screenshot.
- The late joiner of the external video test waited 10 s before looking
  for the video; it now waits up to the same total for the video itself.
- The learning dashboard reloaded after 10 s to see the meeting duration
  grow; it now reloads every second until it has.
- The clock-skew recording test waited 5 s for the RTT worker; it now
  waits for the /rtt-check response itself.
- Shared helpers: the presentation manager's list is waited for (the
  thumbnail of the shown or minimized presentation) instead of 500 ms in
  each upload, and the breakout panel waits for the attendee and the first
  room instead of 2 s before every breakout test drags the attendee.
- Some waits before screenshot comparisons now rely on
  prepareForScreenshot and the stable-frame check of toHaveScreenshot,
  which compares the first stable frame and does not retry after it, so
  each waits for what the frame needs first: the exported-presentation
  screenshots wait for the whiteboard to swap in the new slide (it does so
  only once the image is decoded), the cameras-only layout waits for both
  webcams, and the participants-and-chat layout has no presentation to
  settle. The screenshot of two freshly joined breakout rooms keeps its
  wait, since nothing marks the first slide of a fresh join as painted.

The recording tests' progress-bar waits were already polls on this
branch (bigbluebutton#26088), so that part is left as it is. The external video
late-joiner wait goes from a fixed ELEMENT_WAIT_LONGER_TIME to waiting
for the attendee's video frame, within the same YouTube-based helpers
the branch has today.

Six leaf titles repeated within a spec file, so -g and title-based lists
could not tell the tests apart. They now say what differs: the breakout
duration change in the creation form or of running rooms, the unified
layout minimize for a moderator without or in audio, and the four layout
tests named after the parameter they use (meetingLayout= or
enforceLayout=). No workflow, README, sdk-flaky-tests.txt or snapshot
name refers to the old titles; the four layout tests keep their
quarantine tag and issue link.
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