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: test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x
Type: Stage: resolved
Components: Tests Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: koobs, vstinner
Priority: normal Keywords:

Created on 2020-03-13 12:24 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (8)
msg364089 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-13 12:24
It started to at build 385 or 386.

AMD64 FreeBSD Shared 3.x:
https://buildbot.python.org/all/#/builders/152/builds/391

======================================================================
FAIL: test_specific_shell (test.test_subprocess.POSIXProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_subprocess.py", line 2180, in test_specific_shell
    self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii'))
AssertionError: b'' != b'/usr/local/bin/bash'
msg364090 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-13 12:38
It looks like an installation issue:

% /usr/local/bin/bash -c ""       
ld-elf.so.1: Shared object "libncurses.so.8" not found, required by "bash"
msg364136 - (view) Author: Kubilay Kocak (koobs) (Python triager) Date: 2020-03-14 02:13
Updated FreeBSD CURRENT base, which removed libncurses. The bash port installation needed to be rebuilt. 

@Victor Can tests be skipped on the basis of required dependencies failing to load/run?
msg364170 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-14 14:33
> @Victor Can tests be skipped on the basis of required dependencies failing to load/run?

No idea how to detect such issue. For me, such installation issue is uncommon and it's easier to fix your system rather than trying to skip the test.
msg364219 - (view) Author: Kubilay Kocak (koobs) (Python triager) Date: 2020-03-15 04:52
Not suggesting it's the *best* way, but for example, isn't there a way to handle return codes from shell executions such as:

https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError
msg364319 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-16 13:46
Do you suggest to skip the test if returncode has a specific value?
msg364380 - (view) Author: Kubilay Kocak (koobs) (Python triager) Date: 2020-03-17 01:23
The current test runs a try/finally without any exception handling, so even minimal exception handling will cover a large swatch of potential issues.

CalledProcessError [1] returned by check_call() or check_output() appears to be handy

[1] https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError
msg366906 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-04-21 01:08
AMD64 FreeBSD Shared 3.x is green again, I close the issue.
History
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84135
2020-04-21 01:08:54vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg366906

stage: resolved
2020-03-17 01:23:01koobssetmessages: + msg364380
2020-03-16 13:46:45vstinnersetmessages: + msg364319
2020-03-15 04:52:13koobssetmessages: + msg364219
2020-03-14 14:33:52vstinnersetstatus: pending -> open

messages: + msg364170
2020-03-14 02:13:13koobssetstatus: open -> pending

messages: + msg364136
2020-03-13 12:38:40vstinnersetmessages: + msg364090
2020-03-13 12:24:34vstinnersetnosy: + koobs
2020-03-13 12:24:25vstinnercreate