Skip to content

Commit 246cb6f

Browse files
committed
feat ci: fix flapping tests and CI scripts
Tests: протестировано CI, на прод не влияет commit_hash:4187dbe60f9212b4a5caf276fa5f2a2e25bb13ec
1 parent 07197d7 commit 246cb6f

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/alpine.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ env:
1515
CC: clang-22
1616
CCACHE_DIR: /home/runner/.cache/ccache
1717
CCACHE_NOHASHDIR: true
18-
CPM_SOURCE_CACHE: /home/runner/.cache/CPM
18+
# Keep CPM cache on the same filesystem as the build tree. gRPC's
19+
# download_archive uses file(RENAME) from build_debug/ into the CPM cache;
20+
# a separate bind-mount for CPM_SOURCE_CACHE causes "Cross-device link".
21+
CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm
1922

2023
jobs:
2124
posix:
@@ -73,7 +76,6 @@ jobs:
7376
with:
7477
volumes: |
7578
${{env.CCACHE_DIR}}:${{env.CCACHE_DIR}}
76-
${{env.CPM_SOURCE_CACHE}}:${{env.CPM_SOURCE_CACHE}}
7779
7880
- name: Install dependencies
7981
shell: alpine.sh --root {0}

postgresql/src/storages/postgres/tests/pool_pgtest.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ std::shared_ptr<pg::detail::ConnectionPool> CreateCleanupPool(
4040
const pg::Dsn& dsn,
4141
engine::TaskProcessor& task_processor,
4242
pg::InitMode init_mode,
43-
pg::PoolSettings pool_settings = pg::PoolSettings{1, 1, 10},
44-
pg::CommandControl command_control = pg::CommandControl{std::chrono::milliseconds{100}, std::chrono::seconds{1}}
43+
pg::CommandControl command_control,
44+
pg::PoolSettings pool_settings = pg::PoolSettings{1, 1, 10}
4545
) {
4646
return pg::detail::ConnectionPool::Create(
4747
dsn,
@@ -468,7 +468,14 @@ UTEST_P(PostgrePool, CleanupTaskUseBackgroundFlagAffectsInheritedDeadlinePropaga
468468
return;
469469
}
470470

471-
auto background_pool = CreateCleanupPool(GetDsnFromEnv(), GetTaskProcessor(), GetParam());
471+
// statement_timeout must be shorter than network_timeout so pg_sleep hits
472+
// QueryCancelled (server-side) rather than ConnectionTimeoutError (client).
473+
auto background_pool = CreateCleanupPool(
474+
GetDsnFromEnv(),
475+
GetTaskProcessor(),
476+
GetParam(),
477+
pg::CommandControl{utest::kMaxTestWaitTime, std::chrono::milliseconds{10}}
478+
);
472479
const auto background_behavior_errors = TriggerCleanupWithExpiredInheritedDeadline(background_pool);
473480
EXPECT_EQ(background_behavior_errors, 0) << "Background cleanup task should not inherit expired request deadline";
474481
}
@@ -852,8 +859,8 @@ UTEST_P(PostgrePool, ConnectionRateLimitThrottlesAfterFailedCleanup) {
852859
GetDsnFromEnv(),
853860
GetTaskProcessor(),
854861
GetParam(),
855-
pg::PoolSettings{0, 3, 10, 0, kHugeConnectingIntervalMs},
856-
pg::CommandControl{std::chrono::seconds{5}, std::chrono::seconds{30}}
862+
pg::CommandControl{std::chrono::seconds{5}, std::chrono::seconds{30}},
863+
pg::PoolSettings{0, 3, 10, 0, kHugeConnectingIntervalMs}
857864
);
858865

859866
const auto errors_before = pool->GetStatistics().connection.error_total.Load();

0 commit comments

Comments
 (0)