From 9aaa02bc9a1492a93435a82c022a18dba8318f7d Mon Sep 17 00:00:00 2001 From: Arthur Petukhovsky Date: Wed, 10 Nov 2021 17:18:07 +0300 Subject: [PATCH] Fix high CPU usage in walproposer (#860) * Bump vendor/postgres * Update time limits for test_restarts_under_load --- .circleci/config.yml | 8 +++++--- test_runner/batch_others/test_wal_acceptor_async.py | 9 +++++---- vendor/postgres | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 32319784e1..8e858a61d1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -239,9 +239,11 @@ jobs: - run: name: Run pytest working_directory: test_runner - # pytest doesn't output test logs in real time, so CI job may fail - # with `Too long with no output` error, if a test is running for a long time. - no_output_timeout: 20m + # pytest doesn't output test logs in real time, so CI job may fail with + # `Too long with no output` error, if a test is running for a long time. + # In that case, tests should have internal timeouts that are less than + # no_output_timeout, specified here. + no_output_timeout: 10m environment: - ZENITH_BIN: /tmp/zenith/bin - POSTGRES_DISTRIB_DIR: /tmp/zenith/pg_install diff --git a/test_runner/batch_others/test_wal_acceptor_async.py b/test_runner/batch_others/test_wal_acceptor_async.py index f7291b59ac..d53ae88e0c 100644 --- a/test_runner/batch_others/test_wal_acceptor_async.py +++ b/test_runner/batch_others/test_wal_acceptor_async.py @@ -109,7 +109,7 @@ async def wait_for_lsn(safekeeper: Safekeeper, timeline_id: str, wait_lsn: str, polling_interval=1, - timeout=200): + timeout=60): """ Poll flush_lsn from safekeeper until it's greater or equal than provided wait_lsn. To do that, timeline_status is fetched from @@ -147,9 +147,10 @@ async def run_restarts_under_load(pg: Postgres, acceptors: List[Safekeeper], n_w period_time = 10 iterations = 6 - # Set timeout for this test at 15 minutes. It should be enough for - # test to complete and less than CircleCI's no_output_timeout. - test_timeout_at = time.monotonic() + 15 * 60 + # Set timeout for this test at 5 minutes. It should be enough for test to complete + # and less than CircleCI's no_output_timeout, taking into account that this timeout + # is checked only at the beginning of every iteration. + test_timeout_at = time.monotonic() + 5 * 60 pg_conn = await pg.connect_async() tenant_id = await pg_conn.fetchval("show zenith.zenith_tenant") diff --git a/vendor/postgres b/vendor/postgres index d959b46996..ecc62663ae 160000 --- a/vendor/postgres +++ b/vendor/postgres @@ -1 +1 @@ -Subproject commit d959b4699688a12bbaa6268da838e632e46f1350 +Subproject commit ecc62663ae339c3afe7b44bd5049cc67fe6947d3