Skip to content

Commit

Permalink
test_runner: fix neon_local usage for version mismatch tests (#10859)
Browse files Browse the repository at this point in the history
## Problem

Tests with mixed versions of binaries always pick up new versions if
services are started using `neon_local`.

## Summary of changes
- Set `neon_local_binpath` along with `neon_binpath` and
`pg_distrib_dir` for tests with mixed versions
  • Loading branch information
bayandin authored Feb 17, 2025
1 parent 811506a commit 27241f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion test_runner/fixtures/neon_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ def __init__(
self.test_may_use_compatibility_snapshot_binaries = False
self.version_combination = combination
self.mixdir = self.test_output_dir / "mixdir_neon"

if self.version_combination is not None:
assert (
self.compatibility_neon_binpath is not None
Expand Down Expand Up @@ -702,6 +703,11 @@ def ignore_postgres_log(path: str, _names):

def _mix_versions(self):
assert self.version_combination is not None, "version combination must be set"

# Always use a newer version of `neon_local`
(self.mixdir / "neon_local").symlink_to(self.neon_binpath / "neon_local")
self.neon_local_binpath = self.mixdir

for component, paths in COMPONENT_BINARIES.items():
directory = (
self.neon_binpath
Expand All @@ -711,9 +717,10 @@ def _mix_versions(self):
for filename in paths:
destination = self.mixdir / filename
destination.symlink_to(directory / filename)
self.neon_binpath = self.mixdir

if self.version_combination["compute"] == "old":
self.pg_distrib_dir = self.compatibility_pg_distrib_dir
self.neon_binpath = self.mixdir

def overlay_mount(self, ident: str, srcdir: Path, dstdir: Path):
"""
Expand Down
10 changes: 5 additions & 5 deletions test_runner/fixtures/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
# Disable auto-formatting for better readability
# fmt: off
VERSIONS_COMBINATIONS = (
{"storage_controller": "new", "storage_broker": "new", "compute": "new", "safekeeper": "new", "pageserver": "new"},
{"storage_controller": "new", "storage_broker": "new", "compute": "old", "safekeeper": "old", "pageserver": "old"},
{"storage_controller": "new", "storage_broker": "new", "compute": "old", "safekeeper": "old", "pageserver": "new"},
{"storage_controller": "new", "storage_broker": "new", "compute": "old", "safekeeper": "new", "pageserver": "new"},
{"storage_controller": "old", "storage_broker": "old", "compute": "new", "safekeeper": "new", "pageserver": "new"},
{"storage_controller": "new", "storage_broker": "new", "compute": "new", "safekeeper": "new", "pageserver": "new"}, # combination: nnnnn
{"storage_controller": "new", "storage_broker": "new", "compute": "old", "safekeeper": "old", "pageserver": "old"}, # combination: ooonn
{"storage_controller": "new", "storage_broker": "new", "compute": "old", "safekeeper": "old", "pageserver": "new"}, # combination: ononn
{"storage_controller": "new", "storage_broker": "new", "compute": "old", "safekeeper": "new", "pageserver": "new"}, # combination: onnnn
{"storage_controller": "old", "storage_broker": "old", "compute": "new", "safekeeper": "new", "pageserver": "new"}, # combination: nnnoo
)
# fmt: on

Expand Down

1 comment on commit 27241f0

@github-actions
Copy link

@github-actions github-actions bot commented on 27241f0 Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1370 tests run: 1320 passed, 10 failed, 40 skipped (full report)


Failures on Postgres 17

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_fast_import_restore_to_connstring[release-pg17] or test_fast_import_restore_to_connstring[release-pg17] or test_fast_import_binary[release-pg17] or test_fast_import_binary[release-pg17] or test_fast_import_restore_to_connstring_from_s3_spec[release-pg17] or test_fast_import_restore_to_connstring_from_s3_spec[release-pg17] or test_fast_import_with_pageserver_ingest[release-pg17] or test_fast_import_with_pageserver_ingest[release-pg17] or test_neon_cli_basics[release-pg17] or test_neon_cli_basics[release-pg17]"
Flaky tests (1)

Postgres 17

Test coverage report is not available

The comment gets automatically updated with the latest test results
27241f0 at 2025-02-18T02:32:45.224Z :recycle:

Please sign in to comment.