Skip to content

Fix flaky tests main - #2060

Open
Alena0704 wants to merge 8 commits into
apache:mainfrom
Alena0704:fix-flaky-tests-main
Open

Alena0704 wants to merge 8 commits into
apache:mainfrom
Alena0704:fix-flaky-tests-main

Conversation

@Alena0704

Copy link
Copy Markdown
Collaborator

Collect all fixes from #2032 that can improve CI stability after having reviewed with refactored commit messages.

Author: Dianjin Wang wangdianjin@gmail.com
Assisted-by: Claude Code

Also ported fix for main from #2034

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@Alena0704
Alena0704 force-pushed the fix-flaky-tests-main branch 2 times, most recently from c74f29d to 505f0f3 Compare September 29, 2026 16:40
@Alena0704 Alena0704 mentioned this pull request Sep 29, 2026
13 tasks

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leborchuk leborchuk added the CI label Oct 2, 2026
Comment thread src/test/regress/sql/task.sql
Comment thread src/test/isolation2/sql/resgroup/resgroup_cpu_max_percent.sql
@Alena0704
Alena0704 force-pushed the fix-flaky-tests-main branch 3 times, most recently from 42391a6 to 9e144de Compare October 4, 2026 21:09
tuhaihe and others added 7 commits October 6, 2026 16:50
Replace pg_sleep() with gp_stat_force_next_flush() to force a stats
flush instead of waiting. Update the expected output.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE
Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE
The test already averages CPU samples, but the expected values are
still too low. The suite sets the cluster CPU limit to 100%, so expect
100% for one uncapped group and 33%/67% for groups with weights 100/200.

Keep the existing tolerance of 10 percentage points.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE
These tasks only check that valid schedules are accepted.
Deactivate them after creation to avoid background runs interfering
with cleanup and the oid_wraparound test.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE
The tests read pg_stat_all_tables right after the DELETE, while the
stats of the aborted inserts may not have arrived yet and those of the
DELETE may already have.  Wait for the stats of the aborts and read the
view before the DELETE instead.
Run CHECKPOINT before waiting for the standby to catch up, so the
slot's restart_lsn is updated before checking WAL status.

Ported from Greenplum.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE
@Alena0704
Alena0704 force-pushed the fix-flaky-tests-main branch from b9df400 to 4cfeffd Compare October 6, 2026 13:50
hot_standby/transaction_isolation deliberately panics the standby and
reconnects to check distributed transaction visibility after recovery.
The new connection can arrive before consistent recovery is reached,
when the server reports "the database system is not yet accepting
connections". This message was missing from the connection retry list.

Retry this transient state using the existing attempt limit and interval.
Keep the crash scenario and all transaction visibility checks intact.

Backport required: REL_2_STABLE is affected by the same race.
@Alena0704
Alena0704 force-pushed the fix-flaky-tests-main branch from 4cfeffd to e9ab4a4 Compare October 6, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants