Skip to content

Fix test_unit_recovery_base for newer bash - #2368

Draft
tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:fix-test-unit-recovery-base
Draft

tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:fix-test-unit-recovery-base

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Nov 20, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Two tests compare the error text of an unknown command with
"/bin/bash: invalid_cmd_str: command not found". Bash 5.1 and later
print "/bin/bash: line 1: invalid_cmd_str: command not found", so the
tests fail on Rocky Linux 9, Ubuntu 22.04 and later.

Get the message from the local bash and build the expected JSON from it.

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Test Plan

  • Unit tests added/updated

gppylib.test.unit.test_unit_recovery_base passes as gpadmin in a cbdb-build-rocky9 container with mock 5.0.0 and a
demo cluster, run from gpMgmt/bin with:

PYTHONPATH=.:../sbin:$PYTHONPATH:ext:lib:gppylib python3 -m unittest -v gppylib.test.unit.test_unit_recovery_base

Checklist

Additional Context

No CI job runs this module today, which is why the failure was not seen.
I found it while adding the gpMgmt unit tests to the Behave workflow
(branch ci-more-gpmgmt-unit-tests). After that change and this PR
are merged, gppylib.test.unit.test_unit_recovery_base can be added to the ic-unit-gpmgmt list.

Two tests compare the error text of an unknown command with
"/bin/bash: invalid_cmd_str: command not found".  Bash 5.1 and later
print "/bin/bash: line 1: invalid_cmd_str: command not found", so the
tests fail on Rocky Linux 9, Ubuntu 22.04 and later.

Get the message from the local bash and build the expected JSON from it.

Backpatch-through: REL_2_STABLE
Assisted-by: Claude Code
@tuhaihe
tuhaihe marked this pull request as draft November 20, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant