Skip to content
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

sink(ticdc): fix broken test in cdc/sink/mq & migrate test-infra to testify #5386

Merged
merged 7 commits into from
May 18, 2022

Conversation

CharlesCheung96
Copy link
Contributor

@CharlesCheung96 CharlesCheung96 commented May 11, 2022

What problem does this PR solve?

Issue Number: close #2907

What is changed and how it works?

  1. fix goroutine leak in cdc/sink/mq/producer
  2. migrate test-infra to testify & enable leak testing
  3. fix broken mq_test

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change

Release note

`None`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 11, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • amyangfei
  • hi-rustin

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 11, 2022
@CharlesCheung96 CharlesCheung96 changed the title sink(ticdc): fix goroutine leak in cdc/sink/mq & migrate test-infra to testify [WIP] sink(ticdc): fix goroutine leak in cdc/sink/mq & migrate test-infra to testify May 11, 2022
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 11, 2022
@CharlesCheung96 CharlesCheung96 added the area/ticdc Issues or PRs related to TiCDC. label May 11, 2022
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 12, 2022
@CharlesCheung96 CharlesCheung96 added component/sink Sink component. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 17, 2022
@CharlesCheung96 CharlesCheung96 changed the title [WIP] sink(ticdc): fix goroutine leak in cdc/sink/mq & migrate test-infra to testify sink(ticdc): fix goroutine leak in cdc/sink/mq & migrate test-infra to testify May 17, 2022
@CharlesCheung96 CharlesCheung96 changed the title sink(ticdc): fix goroutine leak in cdc/sink/mq & migrate test-infra to testify sink(ticdc): fix broken test in cdc/sink/mq & migrate test-infra to testify May 17, 2022
@CharlesCheung96
Copy link
Contributor Author

/run-all-tests

Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Thanks!

err := worker.addEvent(context.Background(), event)
require.NoError(t, err)
err := worker.addEvent(ctx, event)
if event.row == nil || event.row.CommitTs != math.MaxUint64 {
Copy link
Member

Choose a reason for hiding this comment

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

I don't quite understand this judgment, can you explain it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ref: https://github.com/pingcap/tiflow/pull/5386/files#diff-f95a3eed29e34d64995f1240ff99fc59e9bf2c95fbc9b88a9bd1cc0d0b32fc7dR169

This event will not be processed by the batch function, so it needs to be judged separately. Otherwise either the test fails here or a Goroutine leak occurs

Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a comment here? Thanks!

cdc/sink/mq/mq_test.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2022
Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. Could you please resolve the conflict?

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 18, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 18, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2022
@Rustin170506
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 0078166

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 18, 2022
@Rustin170506
Copy link
Member

/run-dm-integration-test

@CharlesCheung96
Copy link
Contributor Author

/run-integration-test

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2022

Codecov Report

Merging #5386 (fe8bdf9) into master (7a80b61) will increase coverage by 0.3128%.
The diff coverage is 51.1784%.

Flag Coverage Δ
cdc 61.6261% <43.7500%> (+0.6619%) ⬆️
dm 52.0011% <68.5393%> (+0.0408%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             master      #5386        +/-   ##
================================================
+ Coverage   55.9233%   56.2362%   +0.3128%     
================================================
  Files           528        530         +2     
  Lines         69935      69962        +27     
================================================
+ Hits          39110      39344       +234     
+ Misses        27100      26858       -242     
- Partials       3725       3760        +35     

@Rustin170506
Copy link
Member

/run-all-tests

@ti-chi-bot
Copy link
Member

@CharlesCheung96: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@Rustin170506
Copy link
Member

/run-verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. component/sink Sink component. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate test-infra to testify for cdc/sink pkg
5 participants