Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apple] Failed to connect to port on device #1048

Closed
kotlarmilos opened this issue Jul 11, 2023 · 1 comment
Closed

[apple] Failed to connect to port on device #1048

kotlarmilos opened this issue Jul 11, 2023 · 1 comment

Comments

@kotlarmilos
Copy link
Member

Description

https://helix.dot.net/api/jobs/4cbf9a6d-6389-43f9-9e2c-16540105525e/workitems?api-version=2019-06-17

Both tests pass based on the logs, but one of them is unable to establish a connection via TCP, while the other establishes a connection every time. This failure seems to be permanent and could be a good starting point for identifying the issue.

When I attempted to reproduce the error locally, I encountered the same issue.

Repro steps

Host: osx-arm64
Device: iPhone iOS 16.5.1
Xcode: 14.3.1 (14E300c)

  1. Install xharness locally (I don't believe it has anything with the repro, that is just my local setup):
# Using bash on Linux/MacOS
curl -L https://aka.ms/get-xharness | bash -
  1. Download the bundle and place it in a test directory.
    tracing_eventpipe_tcp_issue.zip

  2. Run the following script from the local directory:

./xharness apple test --app "<LOCAL_DIRECTORY>/tracing_eventpipe_tcp_issue.app" --target "ios-device" --output-directory "<LOCAL_DIRECTORY>/output" --set-env=MONO_APPLE_APP_ENTRY_POINT_LIB_NAME=testdir-buffersize/buffersize.dll --set-env=MONO_APPLE_APP_ASSEMBLY_LOAD_PREFIX=testdir-buffersize --xcode /Applications/Xcode.app -v --launch-timeout 00:05:00

The test should start executing and may fail (due to other reasons), but the TCP connection is not established. The app fails locally with

fail: Application test run crashed
      TCP Tunnel Connection Failed to connect to TCP port

Originally posted by @kotlarmilos in dotnet/runtime#82637 (comment)

@kotlarmilos kotlarmilos changed the title Failed to connect to port on device [apple] Failed to connect to port on device Jul 11, 2023
@kotlarmilos
Copy link
Member Author

For the apple test command, XHarness expects the application to contain a TestRunner which is a library you can find in this repository. This library executes unit tests similarly how you would execute them on other platforms. However, the TestRunner from this repository contains more mechanisms that help to work around some issues (mostly in Apple platforms).

The runtime test did not utilize the TestRunner, and it was expected to fail. After further investigation and monitoring of the CI, it appears that the TCP failures might be related to the app. If such a failure occurs, ensure that the app functions correctly or consider using apple run commands.

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

No branches or pull requests

1 participant