diff --git a/nixos/tests.nix b/nixos/tests.nix index 02ac384..2cb856d 100644 --- a/nixos/tests.nix +++ b/nixos/tests.nix @@ -176,6 +176,14 @@ start_all() machine.wait_for_unit("postgresql.service") + # Wait for PostgreSQL setup scripts to complete (database and user creation) + import time + machine.wait_for_unit("postgresql-setup.service", timeout=30) + time.sleep(2) # Give it a moment to finalize + + # Verify database role exists + machine.succeed("sudo -u postgres psql -c '\\du' | grep webref") + # Verify database is accessible with webref user machine.succeed("sudo -u webref psql webref -c 'SELECT 1;'")