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

Introduce execution.Controller with a local no-op implementation #3204

Merged
merged 2 commits into from Jan 11, 2024

Conversation

na--
Copy link
Member

@na-- na-- commented Jul 17, 2023

What?

This is another sliver of the newly refactored #2816, a follow-up to #3191.

It adds the concept of an execution.Controller, a very lightweight API by which multiple k6 instances could synchronize the concurrent execution of different segments of the same test run. However, it doesn't actually add any distributed execution by itself, just a local implementation of it that doesn't do anything (because a single instance doesn't need to synchronize with itself... yet 😅)

Why?

This is a backwards-compatible prerequisite for distributed execution.

As you can see, no tests have been changed beyond adding the extra parameter to execution.NewScheduler(). So this doesn't change any existing k6 behavior. However, it makes merging the distributed execution much easier because it reduces the likelihood of conflicts. For example, I recently had to resolve conflicts between #2816 and #3112. Even ignoring the code conflicts, logical conflicts are also easier to foresee when this is merged into the codebase, and it makes distributed execution a smaller and easier to review PR.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes. (not needed)
  • I have run linter locally (make ci-like-lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

@na-- na-- requested review from oleiade and removed request for mstoykov July 17, 2023 15:33
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2023

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (1fe0563) 73.19% compared to head (3aa520b) 73.16%.

❗ Current head 3aa520b differs from pull request most recent head fd81209. Consider uploading reports for the commit fd81209 to get more accurate results

Files Patch % Lines
execution/scheduler.go 57.57% 7 Missing and 7 partials ⚠️
execution/controller.go 75.00% 1 Missing and 1 partial ⚠️
cmd/inspect.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3204      +/-   ##
==========================================
- Coverage   73.19%   73.16%   -0.03%     
==========================================
  Files         267      261       -6     
  Lines       20076    19910     -166     
==========================================
- Hits        14694    14567     -127     
+ Misses       4468     4413      -55     
- Partials      914      930      +16     
Flag Coverage Δ
ubuntu 73.09% <69.64%> (-0.04%) ⬇️
windows 73.01% <69.64%> (-0.04%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mstoykov
mstoykov previously approved these changes Dec 13, 2023
execution/controller.go Outdated Show resolved Hide resolved
@na--
Copy link
Member Author

na-- commented Dec 13, 2023

Applied PR review suggestion and rebased on top of the latest master

This doesn't change any existing k6 behavior (see how the tests were not touched), but it adds hooks for distributed execution later on.
Copy link
Collaborator

@olegbespalov olegbespalov left a comment

Choose a reason for hiding this comment

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

🚀

@na--
Copy link
Member Author

na-- commented Jan 11, 2024

🎉

@na-- na-- merged commit 033d768 into master Jan 11, 2024
22 checks passed
@na-- na-- deleted the local-execution-controller branch January 11, 2024 11:44
@na-- na-- mentioned this pull request Jan 11, 2024
@olegbespalov olegbespalov mentioned this pull request Jan 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants