Skip to content

Refactor and add connect all client #20173

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nwnt
Copy link
Member

@nwnt nwnt commented Jun 14, 2025

Fix #20052

This also contains quite extensive refactoring for simulateTraffic.

Signed-off-by: Nont <nont@duck.com>

Add doable

Signed-off-by: Nont <nont@duck.com>
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nwnt
Once this PR has been reviewed and has the lgtm label, please assign ahrtr for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot
Copy link

@nwnt: 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
pull-etcd-coverage-report 1b96db6 link true /test pull-etcd-coverage-report

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

Copy link

codecov bot commented Jun 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.24%. Comparing base (cc29bc0) to head (1b96db6).
Report is 12 commits behind head on main.

Additional details and impacted files

see 18 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #20173      +/-   ##
==========================================
- Coverage   69.27%   69.24%   -0.03%     
==========================================
  Files         413      413              
  Lines       34364    34364              
==========================================
- Hits        23805    23797       -8     
- Misses       9160     9170      +10     
+ Partials     1399     1397       -2     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d37ff81...1b96db6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

MaxNonUniqueRequestConcurrency: 3,
}
HighTrafficProfile = Profile{
MinimalQPS: 100,
MaximalQPS: 1000,
BurstableQPS: 1000,
ClientCount: 8,
MemberClientCount: 8,
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a one cluster client here too?

reporting reporter
ids identity.Provider
baseTime time.Time
finish <-chan struct{}
Copy link
Member

@serathius serathius Jun 14, 2025

Choose a reason for hiding this comment

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

You should watch out when creating struct based on collection of argument variables, not all variables are equal.
Don't think finish make sense here. It's more like context, and should be passed like it.

func (s *simulator) runSingleMemberTraffic(ctx context.Context) {
for i := range profile.MemberClientCount {
c := connect([]string{s.hosts[i%len(s.hosts)]}, s.ids, s.baseTime)
go s.reporting.makeReportOf(trafficLoad(ctx, s.tf, s.limiter, s.ids, s.storage, s.concurrencyLimiter, s.keyStore, s.finish)).usingClient(c)
Copy link
Member

Choose a reason for hiding this comment

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

This one line is overloaded. Shorter doesn't mean better,

}
}

func (s *simulator) runAllMemberTraffic(ctx context.Context) {
Copy link
Member

Choose a reason for hiding this comment

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

There is no reason to have separate function for running all member traffic vs single member traffic. It's almost the same code structure. Separating things like this implies that they are less related causing potential confusion in reader.

@@ -43,7 +43,8 @@ var (
MinimalQPS: 100,
MaximalQPS: 1000,
BurstableQPS: 1000,
ClientCount: 3,
MemberClientCount: 3,
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 recommend mixing refactors and feature changes. Can you send a separate PR?

}
}

type reporter struct {
Copy link
Member

Choose a reason for hiding this comment

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

This struct is confusing for me, I don't understand what's doing. Can you instead adopt more #19893 like approach?

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

Successfully merging this pull request may close these issues.

[Antithesis+Robustness] Add a client that connects to all members
3 participants