test_pg_clients: fix test that reads from stdout (#6021)

## Problem

`test_pg_clients` reads the actual result from a *.stdout file,
https://github.com/neondatabase/neon/pull/5977 has added a header to
such files, so `test_pg_clients` started to fail.

## Summary of changes
- Use `capture_stdout` and compare the expected result with the output
instead of *.stdout file content
This commit is contained in:
Alexander Bayandin
2023-12-04 11:18:41 +00:00
committed by GitHub
parent 1d81e70d60
commit e6b2f89fec

View File

@@ -48,6 +48,6 @@ def test_pg_clients(test_output_dir: Path, remote_pg: RemotePostgres, client: st
subprocess_capture(test_output_dir, build_cmd, check=True)
run_cmd = [docker_bin, "run", "--rm", "--env-file", env_file, image_tag]
basepath, _, _ = subprocess_capture(test_output_dir, run_cmd, check=True)
_, output, _ = subprocess_capture(test_output_dir, run_cmd, check=True, capture_stdout=True)
assert Path(f"{basepath}.stdout").read_text().strip() == "1"
assert str(output).strip() == "1"