Skip to content

Prevent Espresso from reporting it is idle too early by re-checking the main queue after idling resources report idle. - #2536

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
piper_1018660560
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
piper_1018660560

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Prevent Espresso from reporting it is idle too early by re-checking the main queue after idling resources report idle.

Ensure UiControllerImpl.loopMainThreadUntilIdle() runs tasks posted to the main thread just before idling resources report idle while enforcing the master IdlingPolicy timeout across re-checks, and avoid enqueuing redundant idle notifications in IdlingResourceRegistry when polling already-idle resources.

@agammann agammann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The two guards address different queue paths: setIdle(true) removes a callback queued during registration, while the looper check avoids enqueueing another one when isIdleNow() is polled after the resource is idle. The new test checks an empty queue after registration, polling, and a direct redundant callback; the existing repeated-transition test still covers real busy-to-idle changes.

…he main queue after idling resources report idle.

Ensure `UiControllerImpl.loopMainThreadUntilIdle()` runs tasks posted to the main thread just before idling resources report idle while enforcing the master `IdlingPolicy` timeout across re-checks, and avoid enqueuing redundant idle notifications in `IdlingResourceRegistry` when polling already-idle resources.

PiperOrigin-RevId: 1018660560
@copybara-service copybara-service Bot changed the title Ignore redundant idle notifications in IdlingResourceRegistry. Prevent Espresso from reporting it is idle too early by re-checking the main queue after idling resources report idle. Nov 17, 2026

This branch has not been deployed

No deployments
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