-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(ci): re-introduce dynamic test scheduler / balancer with addressed false green issue #12286
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
chore
Not part of the core functionality of kong, but still needed
label
Jan 3, 2024
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
4 times, most recently
from
January 3, 2024 14:46
b7274f0
to
84ba934
Compare
samugi
commented
Jan 4, 2024
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
January 4, 2024 10:25
c939312
to
b1cfe7c
Compare
3 tasks
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
January 4, 2024 16:14
b1cfe7c
to
5e33052
Compare
samugi
changed the title
fix(test-scheduler): return correct exit status from busted
fix(test-scheduler): re-introduce and address false green issues
Jan 4, 2024
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
January 4, 2024 16:45
0eb3071
to
b1d31dc
Compare
samugi
changed the title
fix(test-scheduler): re-introduce and address false green issues
fix(test-scheduler): re-introduce scheduler and address false green issues
Jan 4, 2024
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
January 5, 2024 10:36
c7e484c
to
a720be1
Compare
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
January 5, 2024 10:38
a720be1
to
1efb245
Compare
samugi
commented
Jan 9, 2024
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
11 times, most recently
from
January 15, 2024 12:20
84a758c
to
183483e
Compare
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
2 times, most recently
from
January 17, 2024 11:05
3c62cbc
to
13be664
Compare
StarlightIbuki
approved these changes
Jan 18, 2024
@samugi let's not merge this until after 3.6 Feature Freeze, please. |
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
January 19, 2024 14:38
3bfc648
to
b57e096
Compare
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
January 30, 2024 13:33
b57e096
to
e59980c
Compare
samugi
changed the title
fix(ci): re-introduce scheduler and address false green issue
feat(ci): re-introduce scheduler and address false green issue
Jan 30, 2024
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
2 times, most recently
from
January 30, 2024 15:46
0b27d90
to
33b4419
Compare
samugi
changed the title
feat(ci): re-introduce scheduler and address false green issue
feat(ci): re-introduce dynamic test scheduler / balancer with addressed false green issue
Jan 31, 2024
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
3 times, most recently
from
February 8, 2024 08:50
f9be10c
to
5acba23
Compare
This reverts commit e804fd4 effectively reapplying 543004c. Original commit message: This commit adds an automatic scheduler for running busted tests. It replaces the static, shell script based scheduler by a mechanism that distributes the load onto a number of runners. Each runner gets to work on a portion of the tests that need to be run. The scheduler uses historic run time information to distribute the work evenly across runners, with the goal of making them all run for the same amount of time. With the 7 runners configured in the PR, the overall time it takes to run tests is reduced from around 30 minutes to around 11 minutes. Previously, the scheduling for tests was defined by what the run_tests.sh shell script did. This has now changed so that the new JSON file `test_suites.json` is instead used to define the tests that need to run. Like before, each of the test suites can have its own set of environment variables and test exclusions. The test runner has been rewritten in Javascript in order to make it easier to interface with the declarative configuration file and to facilitate reporting and interfacing with busted. It resides in the https://github.com/Kong/gateway-test-scheduler repository and provides its functionality through custom GitHub Actions. A couple of tests had to be changed to isolate them from other tests better. As the tests are no longer run in identical order every time, it has become more important that each test performs any required cleanup before it runs.
* bump test scheduler to v3 * apply changes required by v3: pass `xml-output-file` and `setup-venv-path` params to runner * update busted ci helper to be consistent with EE * reintroduce debug steps in build and test workflow
after fixing the test scheduler helper, new failures emerged. This commit fixes them. fix(test-scheduler): pass github token to gh-storage
We use `busted.subscribe` to override the output handlers with a callback. To implement the mediator pattern, Busted uses [mediator_lua](https://github.com/Olivine-Labs/mediator_lua). The second value returned by the subscription callback is used to decide whether to continue execution of other subscribers. Since we only return `nil`, the test failure was not handled to exit with the right status and failing tests were exiting with `0`. This commit changes the return value of the callback to: `nil, true` so that the original callback is executed to handle the test result and return the correct exit status.
samugi
force-pushed
the
fix/dynamic-test-scheduler-callback
branch
from
February 12, 2024 12:05
5acba23
to
55b9162
Compare
kikito
reviewed
Feb 14, 2024
kikito
approved these changes
Feb 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
chore
Not part of the core functionality of kong, but still needed
plugins/request-transformer
size/XL
skip-changelog
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note for reviewers:
Easier if reviewed commit by commit
Summary
The test scheduler was reverted because of an issue of "false-green" where the CI jobs were returning green results despite some failing Busted tests. This PR:
schedule
job is rerun - happening hereFalse-green bug
This was caused by two issues. Fixing either would resolve the problem. One of them affected the test scheduler, fixed in V2, the second one is described below:
We use
busted.subscribe
to override the Busted output handlers with a callback. To implement the mediator pattern, Busted uses mediator_lua. The second value returned by the subscription callback is used to decide whether to continue execution of other subscribers. Since we only returnnil
, the test failure was not handled to exit with the right status and failing tests were exiting with0
, so the scheduler was interpreting failing results as passing tests. The fix is simply this line.Reproduced failure: https://github.com/Kong/kong/actions/runs/7398042284/job/20126353464?pr=12286#step:17:3090
Fixed: https://github.com/Kong/kong/actions/runs/7398209062/job/20127873115?pr=12286#step:17:5300
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
KAG-3465
KAG-3533