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

Unit tests crash with Xcode 12.5 + Big Sur #15

Closed
jessesquires opened this issue Jul 15, 2021 · 1 comment
Closed

Unit tests crash with Xcode 12.5 + Big Sur #15

jessesquires opened this issue Jul 15, 2021 · 1 comment
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@jessesquires
Copy link
Member

jessesquires commented Jul 15, 2021

Problem

For some reason, unit tests just crash on Xcode 12.5+ during StatusItemController.init:

self.statusItem = NSStatusBar.system.statusItem(withLength: length)

The issue is with NSStatusBar.system 🤷🏼

EDIT: The issue seems to be with Big Sur. Crashes also occur with Xcode 12.4 on Big Sur...

Example logs

https://github.com/hexedbits/StatusItemController/runs/3064104921?check_suite_focus=true

Workaround

Using Xcode 12.4 and macOS 10.15 for now — only for ci.yml

See: #14

Notes

No idea why this is happening. See like an AppKit bug or something?

@jessesquires jessesquires added the bug Something isn't working label Jul 15, 2021
@jessesquires jessesquires added this to the NEXT milestone Jul 15, 2021
@jessesquires jessesquires changed the title Unit tests crash with Xcode 12.5 Unit tests crash with Xcode 12.5 + Big Sur Jul 15, 2021
@jessesquires jessesquires self-assigned this Jul 15, 2021
@jessesquires jessesquires added the help wanted Extra attention is needed label Jul 15, 2021
@jessesquires
Copy link
Member Author

It looks like system behavior changed in BigSur and NSStatusBar.system.statusItem() implements a new assert when called outside of an app context.

The fix here is to embed the framework in an app target, and run tests on the example app.

In other words, we need a separate test harness and cannot test the framework directly.

This would kind of be like trying to test a window-less view controller -- although that does not hit an assert, but I can see how attempting to create a status item without an app is an invalid state, thus the new assert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

No branches or pull requests

1 participant