Skip to content

test(loadgen): add unit tests for worker concurrency distribution#337

Merged
jjk-g merged 1 commit intokubernetes-sigs:mainfrom
sats-23:issue325
Feb 15, 2026
Merged

test(loadgen): add unit tests for worker concurrency distribution#337
jjk-g merged 1 commit intokubernetes-sigs:mainfrom
sats-23:issue325

Conversation

@sats-23
Copy link
Contributor

@sats-23 sats-23 commented Feb 2, 2026

Fixes #325
Add a new test suite to validate how LoadGenerator splits concurrency across workers.

The tests cover evenly
-divisible cases
-remainder handling
-concurrency lower than the number of workers

This also fixes Python 3.9 compatibility by replacing Type | None with Optional[Type], and adds lightweight test-time mocks for asyncio.TaskGroup and typing.TypeAlias so the suite runs cleanly on Python versions below 3.11.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 2, 2026
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 2, 2026
@jjk-g
Copy link
Collaborator

jjk-g commented Feb 2, 2026

Thanks for adding @sats-23!

Can you please take a look at the linting and type checks

@sats-23
Copy link
Contributor Author

sats-23 commented Feb 2, 2026

Thanks for adding @sats-23!

Can you please take a look at the linting and type checks

Done, PTAL!

@jjk-g jjk-g mentioned this pull request Feb 5, 2026
3 tasks
@jjk-g
Copy link
Collaborator

jjk-g commented Feb 6, 2026

@sats-23

Seems to still be hitting linting issues. Can reproduce locally with pdm run validate

@sats-23 sats-23 force-pushed the issue325 branch 2 times, most recently from ccefe08 to 938469e Compare February 9, 2026 04:05
Add a new test suite to validate how LoadGenerator splits concurrency across workers.
The tests cover evenly divisible cases, remainder handling, and scenarios where concurrency is lower than the number of workers.
This also fixes Python 3.9 compatibility by replacing Type | None with Optional[Type], and adds lightweight test-time mocks for asyncio.TaskGroup and typing.TypeAlias so the suite runs cleanly on Python versions below 3.11.

Signed-off-by: Sathvik <Sathvik.S@ibm.com>
@sats-23
Copy link
Contributor Author

sats-23 commented Feb 9, 2026

@sats-23

Seems to still be hitting linting issues. Can reproduce locally with pdm run validate

CI is now passing, PTAL!

@jjk-g jjk-g self-requested a review February 12, 2026 19:54
@jjk-g
Copy link
Collaborator

jjk-g commented Feb 15, 2026

/lgtm
/approve

@jjk-g jjk-g merged commit 025219f into kubernetes-sigs:main Feb 15, 2026
4 of 5 checks passed
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jjk-g, sats-23

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

The pull request process is described here

Details 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Add tests for worker concurrency

3 participants