This document tracks the test regressions and CI failures resolved during the merge of Salt 3006.x into 3007.x (PR #68929).
- Files:
tests/pytests/pkg/downgrade/test_salt_downgrade.pytests/pytests/pkg/upgrade/test_salt_upgrade.py
- Symptom:
AssertionErrorwhere3007.13was incorrectly evaluated as equal to3007.13+187.g813a978cffdue to.base_versionusage. - Fix: Switched to full
packaging.version.Versionobjects for comparison, correctly identifying that dev/git versions are "greater than" the base stable version. Also initializedoriginal_py_version = Noneto resolve pylint warnings.
- Files:
tests/pytests/unit/client/ssh/test_ssh.pytests/pytests/unit/client/ssh/test_password.py
- Symptom:
ValueError(too many values to unpack) andAttributeErrorafter refactoring. - Fix:
- Refactored tests to match the renamed
_handle_routine_threadmethod. - Updated mocks to handle the new 3-tuple return format (
stdout,stderr,retcode). - Added robust
retcode = Nonehandling. - Switched to
ANYforoptsindisplay_outputmocks to accommodate merge-added internal configuration keys.
- Refactored tests to match the renamed
- Files:
tests/integration/modules/test_mine.pytests/pytests/integration/runners/test_mine.py
- Symptom: Flaky failures and race conditions where Mine data was not available immediately after being sent.
- Fix: Ported 30-second polling logic and
mine.updatepatterns frommasterto ensure data consistency before assertions.
- File:
tests/pytests/unit/test_client.py - Symptom:
RuntimeError: Event loop is closedand JID nesting errors inpub_async. - Fix: Ported the
async deftest pattern frommaster, ensuring Tornado/Asyncio loops are properly managed and thatjidandtimeoutare correctly extracted from nested return structures.
- File:
tests/pytests/unit/loader/test_grains_cleanup.py - Symptom: Failures in grain provider cleanup due to stub module interference.
- Fix: Aligned module filtering logic with
masterto correctly handle (and ignore) stub modules that were causing cleanup failures.
- File:
tests/pytests/unit/utils/verify/test_verify.py - Symptom: Hard Crash/Hang of the unit test shard (specifically Unit 4 on Linux).
- Fix: Patched
resource.getrlimitandresource.setrlimit(and Windows equivalents) to prevent the test from actually lowering the process file descriptor limit to 256. Previously, hitting this limit caused Salt's logging and master processes to crash recursively without a summary.
- File:
tests/pytests/pkg/integration/test_salt_user.py - Symptom:
AssertionError: assert 'salt' == 'root'at various paths (e.g.,/etc/salt/pki/minion/minion.pub,/var/cache/salt/master/proc). - Fix: Refactored
test_pkg_pathsto use a non-recursive, explicit path check forsaltuser ownership. This correctly aligns the test with Salt's 3006.x+ multi-user security model, whereroot-owned subdirectories often exist withinsalt-managed parent directories, and avoids the cascading failures caused by the previous recursive logic.
- Symptom: 169+ failures in Ubuntu 24.04 (and other Linux) integration shards.
- Error:
salt.loader.lazy: ERROR Module/package collision: '.../salt/utils/vault.py' and '.../salt/utils/vault'. - Fix: Deleted the redundant
salt/utils/vault.py(which was accidentally restored from 3006.x) in favor of thesalt/utils/vault/directory structure required by 3007.x. Also removed redundanttests/pytests/unit/utils/test_vault.py.
- File:
tests/support/pytest/helpers.py - Symptom:
requests.exceptions.ConnectionErrorin restricted/air-gapped CI environments when downloading Broadcom GPG keys. - Fix: Added a local PGP public key fallback to the
download_filehelper, allowing tests to proceed even when the Broadcom artifactory is unreachable.
- File:
tests/pytests/pkg/upgrade/systemd/test_service_preservation.py - Symptom: 5-hour Hang in package upgrade tests.
- Fix: Disabled automated service stopping for masked units during the
install(upgrade=True)call.systemctl stopcan block indefinitely on masked services in certain environments.
The following core changes were required to enable the test fixes above:
salt/client/ssh/__init__.py: FixedSSH._expand_targetto preserve user prefixes (e.g.,user@host).salt/pillar/__init__.py: Addeddeepcopy(opts)for Pillar renderer isolation.pkg/windows/nsis/installer/Salt-Minion-Setup.nsi: Restored PR-original Windows MSI fix.