Skip to content

Flaky test: DevServer AppLaunch telemetry 'app-launch/connected' — stabilized on master, not backported to release/stable/6.6 #23899

Open

Description

@agneszitte

Summary

Uno.UI.RemoteControl.DevServer.Tests intermittently fails on the AppLaunch telemetry integration tests: the assertion for the uno/dev-server/app-launch/connected telemetry event fails because the event is not observed within the test window.

Failing assertion

AwesomeAssertions.Execution.AssertionFailedException:
Expected filtered.Any(e => ... EventName == eventName) to be True
because Should contain event 'uno/dev-server/app-launch/connected', but found False.
  at Uno.UI.RemoteControl.DevServer.Tests.Telemetry.TelemetryTestBase.AssertHasEvent(...)
     src/Uno.UI.RemoteControl.DevServer.Tests/Telemetry/TelemetryTestBase.cs:219

Affected tests

src/Uno.UI.RemoteControl.DevServer.Tests/AppLaunch/AppLaunchIntegrationTests.cs, which assert uno/dev-server/app-launch/connected:

  • WhenRegisteredAndRuntimeConnects_SuccessEventEmitted
  • WhenRegisteredByAssemblyPathAndRuntimeConnects_SuccessEventEmitted
  • WhenRegisteredAndRuntimeConnects_SuccessEventEmitted_UsingIdeChannel

Why it flakes

These are full integration tests that spin up a real DevServer (Kestrel + /rc WebSocket) and assert that a telemetry event is emitted once a runtime connects. The build logs show the connection lifecycle (the application aborted the connection, Graceful shutdown requested, Application is shutting down) around the failure — i.e. the connected telemetry event is timing/connection-dependent and can be missed under CI load.

Evidence

History (git)

Introduced and most recently maintained by Carl de Billy — feat(app-launch): Add support for tracking application launches and runtime connections in dev server (2025-10-02) through chore: fix using directive ordering (2026-03-23).

Ask

Stabilize the AppLaunch telemetry assertions — e.g. poll/await the connected event with a bounded timeout instead of asserting on an already-captured snapshot, or otherwise make the assertion tolerant of the connection-timing race — so CI doesn't flake on unrelated PRs.

Activity

  1. agneszitte commented on Jul 28, 2026

    @agneszitte
    MemberAuthor

    Cross-check: green on master, flaked only on the PR build

    Confirms this is intermittent, not a persistent break:

    Build Branch Run unit tests task DevServer.Tests (net10.0)
    224559 PR #23894 (SDK-only) failed app-launch/connected assertion failed
    224424 master succeeded passed (Test run summary: Passed!, 6m43s)
    224258 master succeeded passed
    224130 master succeeded passed
    224015 master succeeded passed

    The recent master builds are red overall, but from other stages — the unit-test stage (which runs DevServer.Tests) is green on master. So the AppLaunch telemetry test passes on master and only flaked on an unrelated PR build, consistent with a timing/connection race rather than a regression.

  2. agneszitte commented on Jul 28, 2026

    @agneszitte
    MemberAuthor

    release/stable/6.6 backport decision: not worth it (test-only)

    The stabilization already exists on master but was never backported to release/stable/6.6, which is why the test flakes there while master is green. Relevant master commits (two separate PRs):

    • c35c32ba1e — ephemeral GetRandomPort via TcpListener(IPAddress.Loopback, 0) (collision-proof ports)
    • b85c4e39b7 — StartAsync timeout 30000 → 60000 (host cold-start under CI load) + ServerTelemetryTests tweaks
    • 694918b2f9 (docs), fc6fd11e40 (review feedback)

    Decision: do not backport for now. It's test-harness only — no product/package impact, purely CI hygiene — and the failure is intermittent, so re-running the Tests – Unit Tests stage is a sufficient workaround. A faithful backport is also not clean:

    • Both PRs rewrote GetRandomPort() differently, so cherry-picking b85c4e39b7 after c35c32ba1e conflicts in DevServerTestHelper.cs (and a careless resolution regresses the ephemeral-port fix back to Random.Shared.Next).
    • fc6fd11e40 also bundles unrelated RuntimeTests changes (Given_ListViewBase / Given_ScrollViewer / Given_TextBox.skia), so a whole-PR Mergify backport would drag those into 6.6.

    If it starts costing real time on 6.6 backport PRs (e.g. during SR2): skip the tangled cross-PR cherry-pick and apply a minimal, conflict-free, 6.6-native edit instead — bump StartAsync timeout 30000 → 60000 in Helpers/DevServerTestHelper.cs (the single change that addresses the cold-start cause), optionally the ephemeral GetRandomPort. Near-zero risk, trivially reviewable.

  3. changed the title [-]Flaky test: DevServer AppLaunchIntegrationTests telemetry 'app-launch/connected' intermittently not observed[/-] [+]Flaky test: DevServer AppLaunch telemetry 'app-launch/connected' — stabilized on master, not backported to release/stable/6.6[/+] on Jul 28, 2026
  4. added this to the Platform 6.7 milestone on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions