Skip to content

Commit

Permalink
[xharness] Don't use a dash in the bundle identifer for watchOS proje…
Browse files Browse the repository at this point in the history
…cts. (#6114)

It causes problems with the mscorlib test project, which can't be launched properly.

I'm not sure what's the underlying cause, but here are some of the symptoms:

* The watch app actually shows up fine on the device, but:
* mlaunch isn't notified about the new process, so it thinks the app didn't
  launch.
* The new process doesn't receive any environment variables we try to give it,
  which for instance means that it won't auto-start the tests upon launch.
* If we ask mlaunch to attach with lldb, mlaunch will ask watchOS to launch
  the process in a suspended state while lldb attaches. Yet the watch app
  shows up on the device as if not asked to be suspended upon launch.

It seems that the dash (I assume, because I haven't investigated this very
deeply, I just happened to find a solution that worked) makes watchOS launch
the app as if tapped, instead of launched from an IDE.

The strangest part is that this only happens with the mscorlib test project,
not any of the other test projects we run on the watch, and they all have
dashes in their bundle identifiers... yet replacing the dash with another
character (underscore, letter, removing it altogether) all made things work as
expected.
  • Loading branch information
rolfbjarne committed May 23, 2019
1 parent a989607 commit fc5067e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/xharness/WatchOSTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void CreateWatchOSExtensionProject ()
XmlDocument info_plist = new XmlDocument ();
var target_info_plist = Path.Combine (TargetDirectory, $"Info{Suffix}-extension.plist");
info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, "Info.plist"));
BundleIdentifier = info_plist.GetCFBundleIdentifier () + "-watch";
BundleIdentifier = info_plist.GetCFBundleIdentifier () + "_watch";
if (BundleIdentifier.Length >= 58)
BundleIdentifier = BundleIdentifier.Substring (0, 57); // If the main app's bundle id is 58 characters (or sometimes more), then the watch extension crashes at launch. radar #29847128.
info_plist.SetCFBundleIdentifier (BundleIdentifier + ".watchkitapp.watchkitextension");
Expand Down

3 comments on commit fc5067e

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.10', Running XM tests on '10.10'' 🔥

Build succeeded
✅ Packages: xamarin.ios-12.15.0.116.pkg xamarin.mac-5.15.0.116.pkg
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Xamarin.Mac tests on 10.10 failed: Xamarin.Mac tests on macOS 10.10 failed (xammac_tests) 🔥
🔥 Test run failed 🔥

Test results

2 tests failed, 179 tests passed.

Failed tests

  • [NUnit] Mono SystemXmlLinqTests/watchOS 32-bits - simulator/Debug: Crashed
  • [xUnit] Mono SystemNetHttpUnitTestsXunit/watchOS 32-bits - simulator/Debug: Crashed

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Device tests completed (Failed) on TvOS on Azure DevOps(TvOS): Html Report 🔥

Test results

1 tests failed, 29 tests' device not found, 123 tests passed.

Failed tests

  • monotouch-test/tvOS - device/AssemblyBuildTarget: dylib (debug, profiling): Failed

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Device tests completed (Failed) on iOS on Azure DevOps(iOS): Html Report 🔥

Test results

4 tests failed, 29 tests' device not found, 127 tests passed.

Failed tests

  • monotouch-test/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug): TimedOut
  • [xUnit] Mono BCL tests group 4/iOS Unified 64-bits - device/Release: Failed
  • [xUnit] Mono BCL tests group 4/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (release): Failed
  • [xUnit] Mono BCL tests group 5/iOS Unified 64-bits - device/AssemblyBuildTarget: dylib (debug): HarnessException (Harness exception for '[xUnit] Mono BCL tests group 5': System.NullReferenceException: Object reference not set to an instance of an object
    at xharness.AppRunner.TestsSucceeded (xharness.Log listener_log, System.Boolean timed_out, System.Boolean crashed) [0x0001e] in /Users/xamarinqa/agent/_work/8/s/tests/xharness/AppRunner.cs:546
    at xharness.AppRunner.RunAsync () [0x01862] in /Users/xamarinqa/agent/_work/8/s/tests/xharness/AppRunner.cs:886
    at xharness.RunDeviceTask.RunTestAsync () [0x00653] in /Users/xamarinqa/agent/_work/8/s/tests/xharness/Jenkins.cs:3741
    at xharness.RunDeviceTask.RunTestAsync () [0x00bd3] in /Users/xamarinqa/agent/_work/8/s/tests/xharness/Jenkins.cs:3791
    at xharness.RunTestTask.ExecuteAsync () [0x00191] in /Users/xamarinqa/agent/_work/8/s/tests/xharness/Jenkins.cs:3521
    at xharness.TestTask.RunInternalAsync () [0x00226] in /Users/xamarinqa/agent/_work/8/s/tests/xharness/Jenkins.cs:2604 )

Please sign in to comment.