Skip to content

Commit

Permalink
Fix test again again
Browse files Browse the repository at this point in the history
  • Loading branch information
save-buffer committed Jan 10, 2024
1 parent 76837dd commit ac39a37
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test_runner/regress/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,24 @@
def test_migrations(neon_simple_env: NeonEnv):
env = neon_simple_env
env.neon_cli.create_branch("test_migrations", "empty")

endpoint = env.endpoints.create("test_migrations")
log_path = endpoint.endpoint_path() / "compute.log"

endpoint.respec(skip_pg_catalog_updates=False)
endpoint.start()

time.sleep(1) # Sleep to let migrations run

with endpoint.cursor() as cur:
cur.execute("SELECT id FROM neon_migration.migration_id")
migration_id = cur.fetchall()
assert migration_id[0][0] == 2

with open(log_path, "r") as log_file:
logs = log_file.read()
assert "INFO start_compute:apply_config:handle_migrations: Ran 2 migrations" in logs

endpoint.stop()
endpoint.start()
time.sleep(1) # Sleep to let migrations run
Expand All @@ -24,8 +32,6 @@ def test_migrations(neon_simple_env: NeonEnv):
migration_id = cur.fetchall()
assert migration_id[0][0] == 2

log_path = endpoint.endpoint_path() / "compute.log"
with open(log_path, "r") as log_file:
logs = log_file.read()
assert "INFO start_compute:apply_config:handle_migrations: Ran 2 migrations" in logs
assert "INFO start_compute:apply_config:handle_migrations: Ran 0 migrations" in logs

0 comments on commit ac39a37

Please sign in to comment.