Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@blp
Copy link
Member

@blp blp commented Jan 29, 2026

@blp blp self-assigned this Jan 29, 2026
Copilot AI review requested due to automatic review settings January 29, 2026 00:57
@blp blp added bug Something isn't working CI/CD QA Testing and quality assurance python Pull requests that update python code labels Jan 29, 2026
@blp blp requested a review from gz January 29, 2026 00:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a race condition in Python integration tests where pipeline state transitions could cause test failures. The fix ensures tests wait for pipelines to fully transition out of the "Stopped" state before proceeding with subsequent operations.

Changes:

  • Modified wait_for_deployment_status() to accept either a string or callable predicate for flexible status checking
  • Added synchronization points in test cases to wait for pipeline state transitions before issuing stop commands
  • Added detailed comments explaining the race condition and why the fix is necessary

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/tests/platform/helper.py Enhanced wait_for_deployment_status() to accept callable predicates for more flexible status checks
python/tests/platform/test_pipeline_lifecycle.py Added waits for pipeline state transitions to prevent race conditions in force and non-force stop tests

obj = r.json()
last = obj.get("deployment_status")
if last == desired:
if last == desired if isinstance(desired, str) else desired(last):
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The conditional expression uses nested ternary operators that can be difficult to parse. Consider refactoring to use a more explicit if-else structure for better readability, such as: if (isinstance(desired, str) and last == desired) or (callable(desired) and desired(last)):

Suggested change
if last == desired if isinstance(desired, str) else desired(last):
if isinstance(desired, str):
condition = (last == desired)
else:
condition = desired(last)
if condition:

Copilot uses AI. Check for mistakes.
Comment on lines 227 to 228
wait_for_deployment_status(pipeline_name,
lambda status: status != "Stopped")
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The lambda function and function call are split across two lines with unusual indentation. Consider placing the lambda on the same line as the opening parenthesis or aligning the continuation more conventionally for better readability.

Suggested change
wait_for_deployment_status(pipeline_name,
lambda status: status != "Stopped")
wait_for_deployment_status(
pipeline_name, lambda status: status != "Stopped"
)

Copilot uses AI. Check for mistakes.
Comment on lines 257 to 258
wait_for_deployment_status(pipeline_name,
lambda status: status != "Stopped")
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The lambda function and function call are split across two lines with unusual indentation. Consider placing the lambda on the same line as the opening parenthesis or aligning the continuation more conventionally for better readability.

Suggested change
wait_for_deployment_status(pipeline_name,
lambda status: status != "Stopped")
wait_for_deployment_status(
pipeline_name, lambda status: status != "Stopped"
)

Copilot uses AI. Check for mistakes.
Signed-off-by: feldera-bot <[email protected]>
@abhizer abhizer added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit fbf8877 Jan 29, 2026
1 check passed
@abhizer abhizer deleted the issue1390 branch January 29, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD python Pull requests that update python code QA Testing and quality assurance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants