Skip to content

gh-137973: Add a non-parallel test plan to the iOS testbed project #138018

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

Merged
merged 1 commit into from
Aug 22, 2025

Conversation

freakboy3742
Copy link
Contributor

@freakboy3742 freakboy3742 commented Aug 21, 2025

Modifies the iOS testbed project to add a test plan.

Adding a test plan to the project has three main benefits:

Firstly, it provides the Xcode standard location for defining test arguments. This doesn't change anything for the documented use of the iOS testbed; but for anyone familiar with Xcode, it will be less surprising that using the app's Info.plist as a way to configure test arguments.

Secondly, it allows defining an LLDB startup configuration, removing the need to manually disable signal breakpoints. This means the Xcode project will work out of the box, without the manual configuration of LLDB ignores that was previously required (and documented).

Lastly, and most importantly, it allows the default behavior of the test suite to be configured as non-parallel. The default behavior for iOS Xcode projects is to run in parallel, which means Xcode tries to launch 2 simulators; and because there will be 2 simulators, it's necessary for Xcode to clone the original simulator to provide independent copies.

The second simulator is never used for anything, because the CPython test suite is (at the Xcode level) a single XCTestCase. However, generating the clone and then launching 2 simulators obviously takes more time than just using the simulator that is ready.

However - more importantly, when running in parallel, Xcode doesn't stream test log output of the tests to the console (because parallel tests could cause stdout collisions). This required the iOS testbed to implement a moderately complex locking and simulator discovery mechanism to find the UUID of the test simulator, and then live stream the logs of that simulator so the user could view them.

So - by turning off parallelism, we can eliminate all that complexity, and just run the Xcode project as-is, and test output will appear in the standard Xcode output.

For added bonus points - the simulator locking and discovery logic is the cause of the issues with the recent 20250811 macos-15 image update on GitHub Actions - so by massively simplifying things, we can also restore service on GitHub Actions.

For more added bonus points - if the system running the tests is under load, the separate log streaming approach can drop log messages. This doesn't happen if Xcode displays the test logs directly.


📚 Documentation preview 📚: https://cpython-previews--138018.org.readthedocs.build/

@freakboy3742
Copy link
Contributor Author

!buildbot iOS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 7d86d4e 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F138018%2Fmerge

The command will test the builders whose names match following regular expression: iOS

The builders matched are:

  • iOS ARM64 Simulator PR

Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

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

I did not do a detailed review of each change but, at a quick glance, I didn't see any obvious problems. With these changes, I found my standard make testios setup to run without any issues (which wasn't always the case with iOS simulators) and the wall clock time from start to finish seemed to be significantly less. So looking good to me!

@freakboy3742 freakboy3742 merged commit 2ba2287 into python:main Aug 22, 2025
93 of 95 checks passed
@freakboy3742 freakboy3742 deleted the ios-testbed-cleanup branch August 22, 2025 05:11
@miss-islington-app
Copy link

Thanks @freakboy3742 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 22, 2025
…ect (pythonGH-138018)

Modifies the iOS testbed project to add a test plan. This simplifies the iOS
test runner, as we can now use the built-in log streaming to see test results.
It also allows for some other affordances, like providing a default LLDB config,
and using a standardized mechanism for specifying test arguments.
(cherry picked from commit 2ba2287)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 22, 2025
…ect (pythonGH-138018)

Modifies the iOS testbed project to add a test plan. This simplifies the iOS
test runner, as we can now use the built-in log streaming to see test results.
It also allows for some other affordances, like providing a default LLDB config,
and using a standardized mechanism for specifying test arguments.
(cherry picked from commit 2ba2287)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-app
Copy link

bedevere-app bot commented Aug 22, 2025

GH-138038 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Aug 22, 2025
@bedevere-app
Copy link

bedevere-app bot commented Aug 22, 2025

GH-138039 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 22, 2025
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot iOS ARM64 Simulator 3.x (tier-3) has failed when building commit 2ba2287.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1380/builds/4442) and take a look at the build logs.
  4. Check if the failure is related to this commit (2ba2287) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1380/builds/4442

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 26, done.        
remote: Counting objects:  16% (1/6)        
remote: Counting objects:  33% (2/6)        
remote: Counting objects:  50% (3/6)        
remote: Counting objects:  66% (4/6)        
remote: Counting objects:  83% (5/6)        
remote: Counting objects: 100% (6/6)        
remote: Counting objects: 100% (6/6), done.        
remote: Compressing objects:  16% (1/6)        
remote: Compressing objects:  33% (2/6)        
remote: Compressing objects:  50% (3/6)        
remote: Compressing objects:  66% (4/6)        
remote: Compressing objects:  83% (5/6)        
remote: Compressing objects: 100% (6/6)        
remote: Compressing objects: 100% (6/6), done.        
remote: Total 26 (delta 0), reused 0 (delta 0), pack-reused 20 (from 1)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '2ba2287b85eea3cc3a71d77c6bcf9eb5670ca05d'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 2ba2287b85e gh-137973: Add a non-parallel test plan to the iOS testbed project (#138018)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

ld: warning: ignoring duplicate libraries: '-lm'
ld: warning: ignoring duplicate libraries: '-lm'

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
make: *** [testios] Error 65

freakboy3742 added a commit that referenced this pull request Aug 22, 2025
…ject (GH-138018) (#138039)

Modifies the iOS testbed project to add a test plan. This simplifies the iOS
test runner, as we can now use the built-in log streaming to see test results.
It also allows for some other affordances, like providing a default LLDB config,
and using a standardized mechanism for specifying test arguments.
(cherry picked from commit 2ba2287)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot iOS ARM64 Simulator 3.x (tier-3) has failed when building commit 2ba2287.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1380/builds/4444) and take a look at the build logs.
  4. Check if the failure is related to this commit (2ba2287) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1380/builds/4444

Summary of the results of the build (if available):

Click to see traceback logs
Note: switching to '2ba2287b85eea3cc3a71d77c6bcf9eb5670ca05d'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 2ba2287b85e gh-137973: Add a non-parallel test plan to the iOS testbed project (#138018)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

ld: warning: ignoring duplicate libraries: '-lm'
ld: warning: ignoring duplicate libraries: '-lm'

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
make: *** [testios] Error 65

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot iOS ARM64 Simulator 3.13 (tier-3) has failed when building commit a73515e.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1386/builds/1550) and take a look at the build logs.
  4. Check if the failure is related to this commit (a73515e) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1386/builds/1550

Summary of the results of the build (if available):

Click to see traceback logs
Note: switching to 'a73515e7475c7abc7614c9f59d497af5b8709585'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at a73515e7475 [3.13] gh-137973: Add a non-parallel test plan to the iOS testbed project (GH-138018) (#138039)
Switched to and reset branch '3.13'

configure: WARNING: no system libmpdec found; falling back to bundled libmpdec (deprecated and scheduled for removal in Python 3.16)
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

configure: WARNING: no system libmpdec found; falling back to bundled libmpdec (deprecated and scheduled for removal in Python 3.16)
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:4A7F2ACB-DEB3-48C5-83AB-082A7477C83B, OS:18.2, name:iPhone SE (3rd generation) }
make: *** [testios] Error 65

@freakboy3742
Copy link
Contributor Author

The buildbot failures are due to concurrency issues; I've modified the buildbot config to limit concurrent builds until I can develop a more permanent solution.

hugovk pushed a commit that referenced this pull request Aug 25, 2025
…ject (GH-138018) (#138038)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants