Compare commits

...

3 Commits

Author SHA1 Message Date
Dmitrii Kovalkov
8b8c2bfeae Add sleep(1) 2025-04-22 15:57:24 +02:00
Dmitrii Kovalkov
15656082d8 Merge branch 'main' into diko/test_workload_stuck 2025-04-21 12:35:44 +02:00
Dmitrii Kovalkov
723c9b5ba2 Add test 2025-04-18 10:29:28 +02:00
2 changed files with 16 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
import threading
import time
from typing import TYPE_CHECKING
from fixtures.log_helper import log
@@ -122,7 +123,11 @@ class Workload:
if allow_recreate:
endpoint.safe_psql(f"DROP TABLE IF EXISTS {self.table};")
endpoint.safe_psql(f"CREATE TABLE {self.table} (id INTEGER PRIMARY KEY, val text);")
log.info("XXX LSN 1: %s", str(endpoint.safe_psql("SELECT pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_current_wal_flush_lsn();")[0]))
endpoint.safe_psql("CREATE EXTENSION IF NOT EXISTS neon_test_utils;")
log.info("XXX LSN 2: %s", str(endpoint.safe_psql("SELECT pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_current_wal_flush_lsn();")[0]))
time.sleep(1)
log.info("XXX LSN 3: %s", str(endpoint.safe_psql("SELECT pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_current_wal_flush_lsn();")[0]))
last_flush_lsn_upload(
self.env, endpoint, self.tenant_id, self.timeline_id, pageserver_id=pageserver_id
)

View File

@@ -2,6 +2,8 @@ from __future__ import annotations
from typing import TYPE_CHECKING
from fixtures.workload import Workload
if TYPE_CHECKING:
from fixtures.neon_fixtures import NeonEnvBuilder
@@ -72,3 +74,12 @@ def test_pageserver_catchup_while_compute_down(neon_env_builder: NeonEnvBuilder)
cur.execute("SELECT count(*) FROM foo")
assert cur.fetchone() == (20000,)
def test_workload_stuck(neon_env_builder: NeonEnvBuilder):
env = neon_env_builder.init_start()
workload = Workload(env, env.initial_tenant, env.initial_timeline)
workload.init()
workload.write_rows(10)
workload.validate()