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

[backport -> release/3.6.x] tests: fix flakiness #12581

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

team-gateway-bot
Copy link
Collaborator

Automated backport to release/3.6.x, triggered by a label in #12580.

Original description

Please REBASE and MERGE

Summary

The dynamic test scheduler exposed some issues by disrupting the order of the tests, some of which did not initialize the database or wrote incompatible data to the database, causing the Gateway instance to fail to start and causing the following test to fail.

Starting a Gateway instance even if it's not needed

  • spec/03-plugins/39-ai-request-transformer/01-transformer_spec.lua
  • spec/03-plugins/40-ai-response-transformer/01-transformer_spec.lua

These two test sets start a Gateway instance to launch a mocking server, which can be replaced by the spec.helpers.http_mock.

The database was not initialized before starting the Gateway instance

  • spec/02-integration/09-hybrid_mode/02-start_stop_spec.lua

Starting a service using a fixed port instead of a random port

Since the test sequence is disrupted and the port release is not real-time, this may cause the port to be occupied to the point where the test fails.

Checklist

Issue reference

KAG-3746

ADD-SP and others added 4 commits February 19, 2024 08:09
Some tests might change the DB in front of this test,
which causes incompatible data to prevent the CP from starting up.

(cherry picked from commit df48729)
@ADD-SP ADD-SP merged commit 0216500 into release/3.6.x Feb 19, 2024
31 checks passed
@ADD-SP ADD-SP deleted the backport-12580-to-release/3.6.x branch February 19, 2024 08:35
@team-gateway-bot
Copy link
Collaborator Author

Cherry-pick failed for release/3.6.x: couldn't find remote ref release/3.6.x.
Please ensure that this Github repo has a branch named release/3.6.x.

@team-gateway-bot
Copy link
Collaborator Author

Cherry-pick failed for release/3.6.x, because it was unable to create a new branch.

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream release/3.6.x
git worktree add -d .worktree/cherry-pick-12581-to-release/3.6.x-to-upstream upstream/release/3.6.x
cd .worktree/cherry-pick-12581-to-release/3.6.x-to-upstream
git checkout -b cherry-pick-12581-to-release/3.6.x-to-upstream
ancref=$(git merge-base 510b137268703dece7d0f1a00a439375d2ff9311 0f23b74b8e04a656ab1bfa4bc90efc17f0579583)
git cherry-pick -x $ancref..0f23b74b8e04a656ab1bfa4bc90efc17f0579583

@StarlightIbuki
Copy link
Contributor

I don't feel it is correct to cherry-pick a backporting PR. Is this intended?

@ADD-SP ADD-SP removed the cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee label Feb 19, 2024
@ADD-SP
Copy link
Contributor

ADD-SP commented Feb 19, 2024

I don't feel it is correct to cherry-pick a backporting PR. Is this intended?

I am not sure, but I will cherry-pick and then backport to EE

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

Successfully merging this pull request may close these issues.

3 participants