GithubHelp home page GithubHelp logo

Error when running the tests about pxctest HOT 17 OPEN

plu avatar plu commented on May 11, 2024 1
Error when running the tests

from pxctest.

Comments (17)

plu avatar plu commented on May 11, 2024

Just looking at this error message it's hard to tell what exactly went wrong. Is it possible that you share the products generated by xcodebuild ... build-for-testing? I understand that this is a lot to ask :). But otherwise I'm not sure how I can help, without reproducing the issue.

from pxctest.

tinder-ayu avatar tinder-ayu commented on May 11, 2024

I am running into exact same problem.

source code on fbsimcontrol:

  pid_t testRunnerProcessID = [self.iosTarget.deviceOperator processIDWithBundleID:configuration.testRunner.bundleID error:error];
  if (testRunnerProcessID < 1) {
    return [[XCTestBootstrapError
      describe:@"Failed to determine test runner process PID"]
      fail:error];
  }

So it apparently failed to retrieve the PID of current simulators while simulator was up... But ps -A shows a ton of PIDs associated with iphonesimulator.

This could be FBSimulator issue also...

May I ask what part of product are you asking to see?

from pxctest.

plu avatar plu commented on May 11, 2024

It's really tough to help here without any further information.

It is by the way not trying to find the PID of the simulator, it is trying to find the PID of the test runner process. This is either the application under test, or, for the UI Test case, the UI Test Runner application.

from pxctest.

tinder-ayu avatar tinder-ayu commented on May 11, 2024

Yes but what information do you need @plu to debug, can you be specific

from pxctest.

plu avatar plu commented on May 11, 2024

One possible root cause can be that your app is built for a higher deployment target than the Simulator you want to use.

Example:

screen shot 2017-01-21 at 08 54 09

When I try to run this on a 9.3 Simulator, I get the same error: Failed to determine test runner process PID

$ pxctest run-tests \
    --testrun build/Build/Products/Test_iphonesimulator10.2-x86_64.xctestrun \
    --destination 'os=iOS 9.3'

Error Domain=com.facebook.FBSimulatorControl Code=0 "Failed start test manager" UserInfo={NSLocalizedDescription=Failed start test manager, NSUnderlyingError=0x7f88226276a0 {Error Domain=com.facebook.XCTestBootstrap Code=0 "Failed to determine test runner process PID" UserInfo={NSLocalizedDescription=Failed to determine test runner process PID}}}

This is because the app requires iOS 10.2, so it cannot run on 9.3.

You can find log files per Simulator in this directory: ~/Library/Logs/CoreSimulator/

If I check the log file for the scenario described before, I can see this in the logs:

Jan 21 08:54:44 plubook assertiond[96771]: assertion failed: 16C67 13E233: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
Jan 21 08:54:44 plubook com.apple.CoreSimulator.SimDevice.788CB20A-8430-444B-A052-0D7D503B48FF.launchd_sim[96749] (UIKitApplication:com.plunien.Test[0x77f9][98668]): Service exited due to signal: Trace/BPT trap: 5
Jan 21 08:54:44 plubook assertiond[96771]: assertion failed: 16C67 13E233: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
Jan 21 08:54:44 plubook SpringBoard[98660]: Application 'UIKitApplication:com.plunien.Test[0x77f9]' crashed.

Next step is to figure out why it crashed. Crash log are placed here: ~/Library/Logs/DiagnosticReports

from pxctest.

tinder-ayu avatar tinder-ayu commented on May 11, 2024

Thank you @plu for helping investigating, let me double check my simulator and will let you know in a couple of days.

from pxctest.

andrewcrawford44 avatar andrewcrawford44 commented on May 11, 2024

Were you able to get this working?

I am getting the same error. I see the simulator starting, it tries to open the app then fails with the Failed to determine test runner process PID error. Deployment target is set at 9.3 and I'm running on Simulator 10.2

from pxctest.

ollieatkinson avatar ollieatkinson commented on May 11, 2024

@andrewcrawfordstv can you provide logs for the simulator (~/Library/Logs/CoreSimulator/) and crash logs from the diagnostic reports (~/Library/Logs/DiagnosticReports)?

from pxctest.

andrewcrawford44 avatar andrewcrawford44 commented on May 11, 2024

@ollieatkinson Weird I'm not getting any logs for the times I'm running the tests...

The only thing is this in Core Simulator a few minutes before the tests ran: CoreSimulatorService[424] : Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSLocalizedDescription=Invalid request: Invalid port UUID specified.}

The run command I'm using is this after build for testing: pxctest run-tests --destination 'name=iPhone 7,os=iOS 10.2' --testrun build/Products/UITests_iphonesimulator10.2-x86_64.xctestrun

This results in the error when running the tests:

Error Domain=com.facebook.FBSimulatorControl Code=0 "Failed start test manager" UserInfo={NSLocalizedDescription=Failed start test manager, NSUnderlyingError=0x7fd03d7bb250 {Error Domain=com.facebook.XCTestBootstrap Code=0 "Failed to determine test runner process PID" UserInfo={NSLocalizedDescription=Failed to determine test runner process PID}}}

from pxctest.

SamuelZhaoY avatar SamuelZhaoY commented on May 11, 2024

I also meet the same problem, my deployment target is 7.0 and base SDK is iphoneos9.0. Which makes me feel quite frustrated

from pxctest.

plu avatar plu commented on May 11, 2024

It might also be a 32 Bit vs. 64 Bit Simulator issue. For example iPhone 5 is 32 Bit and iPhone 5s is 64 Bit. If the test target was only compiled for x86_64, they will only run on a 64 Bit Simulator.

It's always a good idea to check the log files here: ~/Library/Logs/CoreSimulator

And the Crashes in Console.app (User Reports).

from pxctest.

andrewcrawford44 avatar andrewcrawford44 commented on May 11, 2024

@plu I'm running the tests on an iPhone 7 Simulator which is 64 bit.

I'm building for testing using this:

xcodebuild build-for-testing -IDEBuildLocationStyle=Custom -IDECustomBuildLocationType=Absolute -IDECustomBuildProductsPath="$PWD/build/Products" -workspace xx.xcworkspace -scheme xxUITests -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.2'

from pxctest.

plu avatar plu commented on May 11, 2024

@andrewcrawfordstv please check the logs here: ~/Library/Logs/CoreSimulator

from pxctest.

andrewcrawford44 avatar andrewcrawford44 commented on May 11, 2024

@plu Only thing that gets updated is CoreSimulator.log but the last entry was about 30 mins before I ran the tests.

Something that might be worth mentioning. I just tried it there with KIF tests and it worked. Although running tests that use import XCTest fail.

from pxctest.

plu avatar plu commented on May 11, 2024

If your test target does not have a Host Application, then I have to disappoint you - this is not supported by pxctest.

from pxctest.

Shashikant86 avatar Shashikant86 commented on May 11, 2024

I can also confirm that with Xcode 8.3.1 it's not possible to run tests. Tests fails with error even we have test target with host application attached.

Error Domain=com.facebook.FBSimulatorControl Code=0 "Failed start test manager" UserInfo={NSLocalizedDescription=Failed start test manager, NSUnderlyingError=0x7fa927ef6530 {Error Domain=com.facebook.XCTestBootstrap Code=0 "Failed to determine test runner process PID" UserInfo={NSLocalizedDescription=Failed to determine test runner process PID}}}

Simulator logs are too noisy and one of the error is

com.apple.CallKit.CallDirectoryMaintenance[46748]: [Default] Error performing migrations: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CallDirectory” in the folder “Library”." UserInfo={NSFilePath=/var/mobile/Library/CallDirectory, NSUnderlyingError=0x7fb05dd08530 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

from pxctest.

plu avatar plu commented on May 11, 2024

Simulator logs are too noisy and one of the error is

I understand that there's a lot to digest when looking at these logs. But that's the best way to figure out what is going wrong. If you want you can upload the logs and I can have a look. Please make sure that you're providing the logs of the correct Simulator (the UDID must match).

from pxctest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.