Skip to content

Conversation

mcollovati
Copy link
Contributor

Introduce a test-only TestSignalEnvironment that captures all Signals-related tasks when no VaadinSession/VaadinService is available (e.g., background threads).
Tests can deterministically flush these tasks via new runPendingSignalsTasks helpers in BaseUIUnitTest.

Fixes #1968

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

Test Results

  155 files  +1    155 suites  +1   14m 1s ⏱️ - 19m 21s
1 145 tests +6  1 139 ✅ +7  6 💤 ±0  0 ❌ ±0 
1 515 runs  +6  1 509 ✅ +7  6 💤 ±0  0 ❌ ±0 

Results for commit dd858d0. ± Comparison against base commit 1312331.

♻️ This comment has been updated with latest results.

Introduce a test-only TestSignalEnvironment that captures all Signals-related
tasks when no VaadinSession/VaadinService is available (e.g., background
threads).
Tests can deterministically flush these tasks via new runPendingSignalsTasks
helpers in BaseUIUnitTest.

Fixes #1968
@mshabarov mshabarov requested a review from tltv October 20, 2025 11:43
Copy link
Member

@tltv tltv left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollovati mcollovati marked this pull request as ready for review October 23, 2025 06:04
@CLAassistant
Copy link

CLAassistant commented Oct 23, 2025

CLA assistant check
All committers have signed the CLA.

@mshabarov
Copy link
Contributor

Component effect is IMO better to set up outside of the background task, as it's more like an "initialization static" code to be run once. I did a small refactoring here b7df31c, it gives a bit more boilerplate code but make these 3 cases independent.

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.

Make sure UI unit tests using signals work out of the box.

4 participants