Skip to content

Commit 1e5713d

Browse files
committed
test: reduce log access time
1 parent 9e1a7c6 commit 1e5713d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testinfra/test_ami_nix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def test_postgrest_read_only_session_attrs(host):
668668
result = run_ssh_command(host['ssh'], "sudo systemctl is-active postgrest")
669669
if not (result['succeeded'] and result['stdout'].strip() == 'active'):
670670
# If PostgREST failed to start, check the logs to see why
671-
log_result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 minutes ago' --no-pager")
671+
log_result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 seconds ago' --no-pager")
672672
print(f"PostgREST failed to start. Recent logs:\n{log_result['stdout']}")
673673
assert False, "PostgREST failed to start after config change"
674674

@@ -684,7 +684,7 @@ def test_postgrest_read_only_session_attrs(host):
684684
print(f"Test request failed: {str(e)}")
685685

686686
# Check PostgREST logs for "session is not read-only" errors
687-
result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 minutes ago' | grep -i 'session is not read-only' || true")
687+
result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 seconds ago' | grep -i 'session is not read-only' || true")
688688

689689
if result['stdout'].strip():
690690
print(f"\nFound 'session is not read-only' errors in PostgREST logs:\n{result['stdout']}")

0 commit comments

Comments
 (0)