Opened 5 years ago

Closed 5 years ago

#30806 closed Bug (fixed)

Tox doesn't pass OBJC_DISABLE_INITIALIZE_FORK_SAFETY for MacOS test uns

Reported by: Christopher Wilcox Owned by: Christopher Wilcox
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Dustin Harrison Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Mac requires that you specify export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

Tox needs to specify to pass the ENV for executions.

Change History (7)

comment:1 by Christopher Wilcox, 5 years ago

Owner: changed from nobody to Christopher Wilcox
Status: newassigned

comment:2 by Carlton Gibson, 5 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Related to #27086. Going to accept as tox should run on a clean checkout.

comment:3 by Dustin Harrison, 5 years ago

I was able to recreate this issue using MacOS Mojave 10.14.6, Python 3.7.3

Without OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES while the tests were running the following messages would occasionally be emitted and eventually the tests would hang:

[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[40052]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

After applying my PR (https://github.com/django/django/pull/11830) and running:

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
tox

all tests pass and don't hang.

comment:4 by Dustin Harrison, 5 years ago

Cc: Dustin Harrison added
Easy pickings: set
Has patch: set

comment:5 by Christopher Wilcox, 5 years ago

Thanks for confirming you are also seeing this Dustin. I also had a fix but was trying to find someone to verify it wasn't just better on my machine. https://github.com/django/django/pull/11835

comment:6 by Carlton Gibson, 5 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Carlton Gibson <carlton@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In b0e92fb:

Fixed #30806 -- Prevented tox tests hanging on macOS.

MacOS users may need to set OBJC_DISABLE_INITIALIZE_FORK_SAFETY=TRUE
(#27086) to prevent tests from hanging. If set, also pass the environment
variable to tox.

Note: See TracTickets for help on using tickets.
Back to Top