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

tests: fix flaky SDK assertion #670

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Sep 30, 2024

What this PR does / why we need it:

This PR aims to fix the flakiness in plugin SDK assertions that appeared in https://github.com/Kong/gateway-operator/actions/runs/11097835652/job/30829655627?pr=667#step:5:373

  kongpluginbinding_unmanaged_test.go:104: FAIL:	CreatePlugin(string,string,string)
        		at: [/home/runner/work/gateway-operator/gateway-operator/controller/konnect/ops/plugin_mock.go:76 /home/runner/work/gateway-operator/gateway-operator/test/envtest/kongpluginbinding_unmanaged_test.go:68]
    kongpluginbinding_unmanaged_test.go:104: FAIL: 0 out of 1 expectation(s) were met.
        	The code you are testing needs to make 1 more call(s).
        	at: [/home/runner/work/gateway-operator/gateway-operator/test/envtest/kongpluginbinding_unmanaged_test.go:104 /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.linux-amd64/src/runtime/asm_amd64.s:1695]

The idea behind the fix is to wait for the resource to have a Konnect ID assigned and only then check the plugin sdk assertions.

@pmalek pmalek added this to the KGO v1.4.x milestone Sep 30, 2024
@pmalek pmalek self-assigned this Sep 30, 2024
@pmalek pmalek force-pushed the test-flaky-kongpluginbinding-unmanaged branch from d1e5beb to 90d01a3 Compare September 30, 2024 10:22
@pmalek pmalek marked this pull request as ready for review September 30, 2024 10:22
@pmalek pmalek requested a review from a team as a code owner September 30, 2024 10:22
@pmalek pmalek enabled auto-merge (squash) September 30, 2024 11:15
@pmalek pmalek force-pushed the test-flaky-kongpluginbinding-unmanaged branch from 24be914 to eb29b36 Compare September 30, 2024 12:19
@pmalek pmalek merged commit f711d75 into main Sep 30, 2024
21 checks passed
@pmalek pmalek deleted the test-flaky-kongpluginbinding-unmanaged branch September 30, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants