Skip to content

Add test for connection cleanup during segment reconfiguration retries - #2393

Open
doefimov wants to merge 1 commit into
apache:mainfrom
doefimov:test/segment-reconfigurer-close-once
Open

doefimov wants to merge 1 commit into
apache:mainfrom
doefimov:test/segment-reconfigurer-close-once

Conversation

@doefimov

@doefimov doefimov commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

As discussed in #2376 (review comment), add test_it_closes_each_connection_only_once to main so the test does not live only in the REL_2_STABLE backport. The fix itself (394e7c5) is already on main; this PR adds only the test.

What does this PR do?

Adds a unit test to test_unit_segment_reconfigurer.py checking that a failed reconnect does not close the previous connection again (no double close after a SQL error followed by a failed reconnect), and asserts the timeout message via str(exception) instead of the deprecated .message attribute.

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

None.

Test Plan

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

All 4 tests in test_unit_segment_reconfigurer.py pass. Without the fix from 394e7c5 the new test fails with a double close.

Impact

Performance: none

User-facing changes: none

Dependencies: none

Checklist

Additional Context

Related: #2376

Check that a failed reconnect does not close the previous connection
again. Assert the timeout message after catching the exception.
@doefimov doefimov changed the title Test connection cleanup during segment reconfiguration retries Add test for connection cleanup during segment reconfiguration retries Nov 22, 2026
@doefimov

Copy link
Copy Markdown
Contributor Author

@reshke could you take a look? This is the test you suggested adding to main in #2376.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant