react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

AutomationChannel's Server should not stop after client disconnects

Open jonthysell opened this issue 1 year ago • 0 comments

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

jonthysell avatar Feb 28 '24 18:02 jonthysell