Updating old tests to use RunOnceCallback and TestFuture [chromium/src : main]

0 views
Skip to first unread message

Joe Downing (Gerrit)

unread,
Mar 10, 2026, 5:36:46 PM (4 days ago) Mar 10
to Yuwei Huang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org
Attention needed from Yuwei Huang

Joe Downing added 1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Joe Downing . resolved

This is a cleanup CL to apply your suggestion for my CL from yesterday to the rest of /remoting. There are a few other changes where instances of 'RunUntilIdle' and similar constructs were replaced to reduce flakiness.

PTAL!

Open in Gerrit

Related details

Attention is currently required from:
  • Yuwei Huang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
Gerrit-Change-Number: 7651677
Gerrit-PatchSet: 8
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Mar 2026 21:36:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Mar 10, 2026, 6:15:42 PM (4 days ago) Mar 10
to Joe Downing, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org
Attention needed from Joe Downing

Yuwei Huang voted and added 2 comments

Votes added by Yuwei Huang

Code-Review+1

2 comments

Patchset-level comments
Yuwei Huang . resolved

Thanks for cleaning this up!

File remoting/host/chromeos/frame_sink_desktop_capturer_unittest.cc
Line 314, Patchset 8 (Latest): return environment_.GetMainThreadTaskRunner()
->RunsTasksInCurrentSequence();
Yuwei Huang . unresolved

It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?

Open in Gerrit

Related details

Attention is currently required from:
  • Joe Downing
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
    Gerrit-Change-Number: 7651677
    Gerrit-PatchSet: 8
    Gerrit-Owner: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Joe Downing <joe...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 22:15:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joe Downing (Gerrit)

    unread,
    Mar 10, 2026, 6:31:15 PM (4 days ago) Mar 10
    to Yuwei Huang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org
    Attention needed from Yuwei Huang

    Joe Downing added 1 comment

    File remoting/host/chromeos/frame_sink_desktop_capturer_unittest.cc
    Line 314, Patchset 8 (Latest): return environment_.GetMainThreadTaskRunner()
    ->RunsTasksInCurrentSequence();
    Yuwei Huang . unresolved

    It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?

    Joe Downing

    Yeah I'll add comments and also run the tests 100 times to look for timing flakes

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yuwei Huang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
    Gerrit-Change-Number: 7651677
    Gerrit-PatchSet: 8
    Gerrit-Owner: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 22:31:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joe Downing (Gerrit)

    unread,
    Mar 11, 2026, 10:43:51 PM (3 days ago) Mar 11
    to Yuwei Huang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org
    Attention needed from Yuwei Huang

    Joe Downing added 2 comments

    Patchset-level comments
    File remoting/host/chromeos/frame_sink_desktop_capturer_unittest.cc
    Line 314, Patchset 8: return environment_.GetMainThreadTaskRunner()
    ->RunsTasksInCurrentSequence();
    Yuwei Huang . resolved

    It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?

    Joe Downing

    Yeah I'll add comments and also run the tests 100 times to look for timing flakes

    Joe Downing

    Comment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yuwei Huang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
    Gerrit-Change-Number: 7651677
    Gerrit-PatchSet: 11
    Gerrit-Owner: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 02:43:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Joe Downing <joe...@chromium.org>
    Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuwei Huang (Gerrit)

    unread,
    Mar 11, 2026, 10:55:10 PM (3 days ago) Mar 11
    to Joe Downing, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org
    Attention needed from Joe Downing

    Yuwei Huang voted and added 1 comment

    Votes added by Yuwei Huang

    Code-Review+1

    1 comment

    File remoting/host/chromeos/frame_sink_desktop_capturer_unittest.cc
    Line 314, Patchset 8: return environment_.GetMainThreadTaskRunner()
    ->RunsTasksInCurrentSequence();
    Yuwei Huang . unresolved

    It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?

    Joe Downing

    Yeah I'll add comments and also run the tests 100 times to look for timing flakes

    Joe Downing

    Comment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.

    Yuwei Huang

    This file doesn't seem to be changed between patch 8 and 11?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joe Downing
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
    Gerrit-Change-Number: 7651677
    Gerrit-PatchSet: 11
    Gerrit-Owner: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Joe Downing <joe...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 02:55:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joe Downing (Gerrit)

    unread,
    Mar 11, 2026, 11:01:42 PM (3 days ago) Mar 11
    to Yuwei Huang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org

    Joe Downing voted and added 2 comments

    Votes added by Joe Downing

    Commit-Queue+2

    2 comments

    Patchset-level comments
    Joe Downing . resolved

    Thanks!

    File remoting/host/chromeos/frame_sink_desktop_capturer_unittest.cc
    Line 314, Patchset 8: return environment_.GetMainThreadTaskRunner()
    ->RunsTasksInCurrentSequence();
    Yuwei Huang . resolved

    It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?

    Joe Downing

    Yeah I'll add comments and also run the tests 100 times to look for timing flakes

    Joe Downing

    Comment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.

    Yuwei Huang

    This file doesn't seem to be changed between patch 8 and 11?

    Joe Downing

    Oops, you're right, I thought I had added it but the comment already indicated what RunUntil was doing so I left it. It turns out this isn't being on an arbitrary thread. It is being run on the main thread. So basically RunUntil is flushing the tasks and then the RunsTaskInCurrentSequence call succeeds immediately and returns.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
      Gerrit-Change-Number: 7651677
      Gerrit-PatchSet: 11
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 03:01:32 +0000
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Mar 11, 2026, 11:05:36 PM (3 days ago) Mar 11
      to Joe Downing, Yuwei Huang, AyeAye, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      Updating old tests to use RunOnceCallback and TestFuture

      Applying CR feedback I received yesterday for a signaling unit test
      to the rest of remoting.
      Bug: NO_BUG
      Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
      Commit-Queue: Joe Downing <joe...@chromium.org>
      Reviewed-by: Yuwei Huang <yuw...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1598177}
      Files:
      • M components/named_mojo_ipc_server/named_mojo_ipc_server.h
      • M components/named_mojo_ipc_server/named_mojo_ipc_server_unittest.cc
      • M components/named_mojo_ipc_server/named_mojo_message_pipe_server.cc
      • M components/named_mojo_ipc_server/named_mojo_message_pipe_server.h
      • M remoting/base/oauth_token_getter_proxy_unittest.cc
      • M remoting/base/queued_task_poster_unittest.cc
      • M remoting/host/audio_capturer_chromeos_unittest.cc
      • M remoting/host/chromeos/audio_helper_chromeos_impl_unittest.cc
      • M remoting/host/chromeos/clipboard_aura_unittest.cc
      • M remoting/host/chromeos/frame_sink_desktop_capturer_unittest.cc
      • M remoting/host/chromoting_host_services_server_unittest.cc
      • M remoting/host/heartbeat_sender_unittest.cc
      • M remoting/host/linux/audio_pipe_reader_unittest.cc
      • M remoting/host/mouse_cursor_monitor_proxy_unittest.cc
      • M remoting/host/resizing_host_observer_unittest.cc
      • M remoting/host/security_key/security_key_message_writer_impl_unittest.cc
      • M remoting/host/webrtc_mouse_cursor_monitor_adaptor_unittest.cc
      • M remoting/signaling/ftl_messaging_client_unittest.cc
      • M remoting/signaling/iq_sender_unittest.cc
      Change size: L
      Delta: 19 files changed, 303 insertions(+), 303 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Yuwei Huang
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
      Gerrit-Change-Number: 7651677
      Gerrit-PatchSet: 12
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      open
      diffy
      satisfied_requirement

      Joe Downing (Gerrit)

      unread,
      Mar 11, 2026, 11:07:22 PM (3 days ago) Mar 11
      to Chromium LUCI CQ, Yuwei Huang, AyeAye, chromium...@chromium.org, chromotin...@chromium.org, oshima...@chromium.org

      Joe Downing added 1 comment

      File remoting/host/chromeos/frame_sink_desktop_capturer_unittest.cc
      Line 314, Patchset 8: return environment_.GetMainThreadTaskRunner()
      ->RunsTasksInCurrentSequence();
      Yuwei Huang . resolved

      It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?

      Joe Downing

      Yeah I'll add comments and also run the tests 100 times to look for timing flakes

      Joe Downing

      Comment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.

      Yuwei Huang

      This file doesn't seem to be changed between patch 8 and 11?

      Joe Downing

      Oops, you're right, I thought I had added it but the comment already indicated what RunUntil was doing so I left it. It turns out this isn't being on an arbitrary thread. It is being run on the main thread. So basically RunUntil is flushing the tasks and then the RunsTaskInCurrentSequence call succeeds immediately and returns.

      Joe Downing

      Thinking about this more, I want to revisit it as there is probably a more intuitive mechanism. Each time I tweak a file, Gerrit removes the +1 so it's faster to iterate on it separately.

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5c68ee6fcb1770a483bae1912e12e0bcf1b1f4a2
      Gerrit-Change-Number: 7651677
      Gerrit-PatchSet: 12
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 03:07:11 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages