[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

br: fix flaky test TestConcurrentLock #57591

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

YuJuncen
Copy link
Contributor
@YuJuncen YuJuncen commented Nov 21, 2024

What problem does this PR solve?

Issue Number: ref #56523

close #57755

Problem Summary:
The test case TestConcurrentLock isn't stable enough.

What changed and how does it work?

Make it more stable by stronger syncing.

# go test -count 2000 -run '^TestConcurrentLock$' github.com/pingcap/tidb/br/pkg/storage
ok      github.com/pingcap/tidb/br/pkg/storage  9.397s

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test

    It is a test.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 21, 2024
Copy link
tiprow bot commented Nov 21, 2024

Hi @YuJuncen. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

Copy link
codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 21.62162% with 29 lines in your changes missing coverage. Please review.

Project coverage is 74.3526%. Comparing base (d0de86b) to head (214ab0a).
Report is 35 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57591        +/-   ##
================================================
+ Coverage   72.8369%   74.3526%   +1.5157%     
================================================
  Files          1677       1722        +45     
  Lines        464141     480323     +16182     
================================================
+ Hits         338066     357133     +19067     
+ Misses       105185     101257      -3928     
- Partials      20890      21933      +1043     
Flag Coverage Δ
integration 48.1584% <13.5135%> (?)

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 55.2924% <21.6216%> (+9.5978%) ⬆️

Copy link
Contributor
@Tristan1900 Tristan1900 left a comment

Choose a reason for hiding this comment

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

LGTM!

br/pkg/storage/local.go Outdated Show resolved Hide resolved
Copy link
ti-chi-bot bot commented Nov 21, 2024

@Tristan1900: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

LGTM!

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 kubernetes-sigs/prow repository.

@YuJuncen
Copy link
Contributor Author

/test unit-test

@YuJuncen YuJuncen closed this Nov 22, 2024
@YuJuncen YuJuncen reopened this Nov 22, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 22, 2024
@hawkingrei
Copy link
Member

/retest

@YuJuncen
Copy link
Contributor Author

/test unit-test

Copy link
tiprow bot commented Nov 27, 2024

@YuJuncen: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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 kubernetes-sigs/prow repository.

@hawkingrei
Copy link
Member

/test all

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@hawkingrei hawkingrei force-pushed the fix-flaky-test-concurrency-lock branch from 2758b86 to 8ac1d3f Compare November 27, 2024 06:10
@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 27, 2024
Copy link
Contributor
@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

/hold

free to unhold

@@ -95,6 +96,11 @@ func (l *LocalStorage) WriteFile(_ context.Context, name string, data []byte) er
if err := os.Rename(tmpPath, filepath.Join(l.base, name)); err != nil {
return errors.Trace(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

comment for WriteFile: maybe check the name does not contain path separator. Because it will cause the file to be created outside of the folder, and sync the folder inode is not enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we can sync the dirpath. 🤔

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 27, 2024
@lance6716
Copy link
Contributor

BTW I doubt what's the root cause of the test. Because unit test is run in 1 process, even if we open the same path twice for 2 FD, they still share the same underlying inode? No need to sync it to disk.

@YuJuncen
Copy link
Contributor Author

BTW I doubt what's the root cause of the test. Because unit test is run in 1 process, even if we open the same path twice for 2 FD, they still share the same underlying inode? No need to sync it to disk.

In fact the main reason of the failure is that we removed the failpoint too fast, which may cause the two participants both failed to commit.

Syncing the inode is needed because not sure why, we may read steal dir content after creating a file in it. Perhaps just opening th e basedir will be enough, but as you commented, that doesn't work with subdirs.

Signed-off-by: hillium <yujuncen@pingcap.com>
@lance6716
Copy link
Contributor

/hold

(I'll post a long comment)

Copy link
tiprow bot commented Nov 29, 2024

@BornChanger: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 29, 2024
Signed-off-by: hillium <yujuncen@pingcap.com>
@YuJuncen
Copy link
Contributor Author

/test build
/test unit-test

@YuJuncen
Copy link
Contributor Author

/test pull-lightning-integration-test

Copy link
tiprow bot commented Nov 29, 2024

@YuJuncen: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test build
/test unit-test

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 kubernetes-sigs/prow repository.

Copy link
tiprow bot commented Nov 29, 2024

@YuJuncen: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-lightning-integration-test

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 kubernetes-sigs/prow repository.

Copy link
Contributor
@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

please fix CI

Copy link
ti-chi-bot bot commented Nov 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, lance6716, Leavrth, Tristan1900

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 29, 2024
Copy link
ti-chi-bot bot commented Nov 29, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-22 13:23:00.189955229 +0000 UTC m=+210767.809609744: ☑️ agreed by hawkingrei.
  • 2024-11-27 06:11:51.659447877 +0000 UTC m=+616899.279102393: ☑️ agreed by Leavrth.
  • 2024-11-27 07:58:55.737775611 +0000 UTC m=+623323.357430126: ✖️🔁 reset by lance6716.
  • 2024-11-29 08:11:04.941034294 +0000 UTC m=+796852.560688810: ☑️ agreed by lance6716.

@YuJuncen
Copy link
Contributor Author

/test unit-test

Copy link
tiprow bot commented Nov 29, 2024

@YuJuncen: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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 kubernetes-sigs/prow repository.

@YuJuncen
Copy link
Contributor Author
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007f436710f191, pid=14, tid=57

It seems Jenkins encounters some problems...

@lance6716
Copy link
Contributor

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 29, 2024
@BornChanger
Copy link
Contributor

/retest

Copy link
tiprow bot commented Dec 2, 2024

@BornChanger: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes-sigs/prow repository.

@YuJuncen
Copy link
Contributor Author
YuJuncen commented Dec 2, 2024

/test unit-test

Copy link
tiprow bot commented Dec 2, 2024

@YuJuncen: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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 kubernetes-sigs/prow repository.

@YuJuncen
Copy link
Contributor Author
YuJuncen commented Dec 2, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Dec 2, 2024
@YuJuncen
Copy link
Contributor Author
YuJuncen commented Dec 2, 2024

/test unit-test

Copy link
tiprow bot commented Dec 2, 2024

@YuJuncen: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test fast_test_tiprow_ddlargsv1
  • /test tidb_parser_test

Use /test all to run the following jobs that were automatically triggered:

  • fast_test_tiprow
  • tidb_parser_test

In response to this:

/test unit-test

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 kubernetes-sigs/prow repository.

@YuJuncen
Copy link
Contributor Author
YuJuncen commented Dec 2, 2024

/test unit-test

Copy link
tiprow bot commented Dec 2, 2024

@YuJuncen: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test fast_test_tiprow_ddlargsv1
  • /test tidb_parser_test

Use /test all to run the following jobs that were automatically triggered:

  • fast_test_tiprow
  • tidb_parser_test

In response to this:

/test unit-test

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 kubernetes-sigs/prow repository.

Signed-off-by: hillium <yujuncen@pingcap.com>
Copy link
ti-chi-bot bot commented Dec 2, 2024

@YuJuncen: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/unit-test 214ab0a link true /test unit-test
pull-lightning-integration-test 214ab0a link true /test pull-lightning-integration-test
pull-br-integration-test 214ab0a link true /test pull-br-integration-test

Full PR test history. Your PR dashboard.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
tiprow bot commented Dec 2, 2024

@YuJuncen: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 214ab0a link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flaky test TestConcurrentLock
6 participants