-
Notifications
You must be signed in to change notification settings - Fork 28
test: modify fail_over_ddl_mix integration test #3427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @wk989898, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request modifies an existing integration test by adjusting a timing parameter. The change extends a sleep duration within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request modifies an integration test by increasing a sleep duration, likely to fix a flaky test. While this might resolve an immediate issue, I've suggested a more robust approach that involves polling for a specific condition (changefeed checkpoint advancement) instead of a fixed wait. This will make the test more reliable and potentially more efficient.
| kill -9 $NORMAL_TABLE_DDL_PID $DML_PID_1 $DML_PID_2 $DML_PID_3 $DML_PID_4 $DML_PID_5 | ||
|
|
||
| sleep 30 | ||
| sleep 60 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increasing the sleep time can make the test more stable, but it's not a robust solution and it slows down the test execution. A better approach is to actively wait for the changefeed to replicate all data up to the point where DMLs were stopped. This can be achieved by polling the changefeed's checkpoint TSO until it surpasses the TSO captured after killing the DML processes. This makes the test both more reliable and potentially faster, as it waits only as long as necessary.
| sleep 60 | |
| # Wait for replication to catch up before checking diff. | |
| # This is more robust than a fixed sleep time. | |
| current_tso=$(run_cdc_cli_tso_query ${UP_PD_HOST_1} ${UP_PD_PORT_1}) | |
| i=0 | |
| while [ $i -lt 60 ]; do | |
| checkpoint_tso=$(cdc_cli_changefeed query -c "test" 2>&1 | grep -v "Command to ticdc" | jq '.checkpoint_tso') | |
| if [[ "$checkpoint_tso" != "null" && "$checkpoint_tso" -ge "$current_tso" ]]; then | |
| echo "Changefeed checkpoint ($checkpoint_tso) has passed target TSO ($current_tso)." | |
| break | |
| fi | |
| sleep 2 | |
| i=$((i+1)) | |
| done | |
| if [ $i -ge 60 ]; then | |
| echo "Timed out waiting for changefeed checkpoint to advance." | |
| cdc_cli_changefeed query -c "test" | |
| exit 1 | |
| fi |
| kill -9 $NORMAL_TABLE_DDL_PID $DML_PID_1 $DML_PID_2 $DML_PID_3 $DML_PID_4 $DML_PID_5 | ||
|
|
||
| sleep 30 | ||
| sleep 60 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the root cause, we need to find the root cause or a better way to avoid it failed
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongyunyan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/hold |
What problem does this PR solve?
Issue Number: ref #442
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note