microsoft / microsoft/react-native-windows

AutomationChannel's Server should not stop after client disconnects

Open
#12,777 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Test Infrastructure enhancement Only Affects Internal Development Workstream: Test Coverage
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

The code in @react-native-windows/automaion that sets up the client's connection typically disconnects after a test suite has run, which make sense. However, currently, Server::PumpRequests() in @react-native-windows/automation-channel will stop handling requests when the first client disconnects.

This typically means that any app running the server (aka. e2e-test-app or e2e-test-app-fabric) will stop accepting new channel connections, meaning the app also has to be restarted in-between test suites. Up till now we've been relying on this, but it shouldn't be unnecessary, and prevents us from running multiple test suites against the same app instance (which would be very useful for debugging an app in a specific state that we don't want to lose by restarting it).

Steps To Reproduce
  1. Launch e2e-test-app-fabric manually (disabling the automatic test launch via rootLaunchApp: false added to jest.config.js in PR #12769):
  2. Run yarn e2etest visitAllTestPages
  3. Run yarn e2etest visitAllTestPages again
Expected Results

The second test run uses the existing app. Instead the test hangs forever trying to reconnect to the (now dead) automation channel server.

CLI version

13.0.0

Environment
npx react-native infoinfo Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26063
  CPU: "(24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores     "
  Memory: 48.66 GB / 63.86 GB
Binaries:
  Node:
    version: 18.17.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.6.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 16.11.34601.136 (Visual Studio Enterprise 2019)
    - 17.9.34616.47 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

ReleaseBundle

Snack, code example, screenshot, or link to a repository

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Server::PumpRequests() in the automation-channel code and reproduce the failure with e2e-test-app-fabric. Run yarn e2etest visitAllTestPages twice with rootLaunchApp: false; done means the second run reconnects and uses the existing app instead of hanging after the first client disconnects.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.