This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: scheduler tests for posix_spawn fail on AMD64 FreeBSD 10.x Shared 3.x
Type: Stage: resolved
Components: Tests Versions: Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2018-09-14 17:41 by pablogsal, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9316 merged pablogsal, 2018-09-14 19:05
Messages (5)
msg325370 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-09-14 17:41
https://buildbot.python.org/all/#/builders/87/builds/1428/steps/4/logs/stdio


======================================================================
ERROR: test_setscheduler_with_policy (test.test_posix.TestPosixSpawn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_posix.py", line 1693, in test_setscheduler_with_policy
    scheduler=(policy, os.sched_param(priority))
PermissionError: [Errno 1] Operation not permitted: '/usr/home/buildbot/python/3.x.koobs-freebsd10/build/python'
======================================================================
FAIL: test_setscheduler_only_param (test.test_posix.TestPosixSpawn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_posix.py", line 1677, in test_setscheduler_only_param
    self.assertEqual(os.waitpid(pid, 0), (pid, 0))
AssertionError: Tuples differ: (96981, 256) != (96981, 0)
First differing element 1:
256
0
- (96981, 256)
?         ^^^
+ (96981, 0)
?         ^
----------------------------------------------------------------------
msg325376 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-09-14 17:56
Some extra stdout when I try to reproduce this on FreeBSD:

test_setscheduler_only_param (test.test_posix.TestPosixSpawn) ... Traceback (most recent call last):
  File "<string>", line 5, in <module>
AttributeError: module 'os' has no attribute 'exit'
FAIL
test_setscheduler_with_policy (test.test_posix.TestPosixSpawn) ... Traceback (most recent call last):
  File "<string>", line 5, in <module>
AttributeError: module 'os' has no attribute 'exit'
FAIL
msg325384 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-09-14 19:04
What is failing is this line in the spawned process:

os.sched_getparam(0).sched_priority != {priority}

For some reason posix_spawn cannot change the priority in BSD. I have tried to hardcode the change in the implementation but the priority does not change in the child.

I am out of ideas, except skipping the tests on these systems.
msg325405 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-09-14 21:55
We already skip similar os.sched_setparam() tests on FreeBSD, so the change is fine.
msg325409 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-09-14 22:12
New changeset 3d18b50a12e639e018d49d7b85663164d60bfd2b by Pablo Galindo in branch 'master':
bpo-34685: Skip posix_spawn scheduler tests on BSD (GH-9316)
https://github.com/python/cpython/commit/3d18b50a12e639e018d49d7b85663164d60bfd2b
History
Date User Action Args
2022-04-11 14:59:05adminsetgithub: 78866
2018-09-15 19:47:21pablogsalsetstatus: open -> closed
stage: patch review -> resolved
2018-09-14 22:12:26pablogsalsetmessages: + msg325409
2018-09-14 21:55:47vstinnersetnosy: + vstinner
messages: + msg325405
2018-09-14 19:05:31pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request8742
2018-09-14 19:04:13pablogsalsetmessages: + msg325384
2018-09-14 17:56:45pablogsalsetmessages: + msg325376
2018-09-14 17:41:12pablogsalcreate