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

frontend: ci test seems to be flaky #1163

Closed
frzifus opened this issue Jan 28, 2025 · 2 comments
Closed

frontend: ci test seems to be flaky #1163

frzifus opened this issue Jan 28, 2025 · 2 comments
Assignees

Comments

@frzifus
Copy link
Collaborator

frzifus commented Jan 28, 2025

https://github.com/Azure/ARO-HCP/actions/runs/13010842188/job/36287996416?pr=1132

	github.com/Azure/ARO-HCP/frontend		coverage: 0.0% of statements
	github.com/Azure/ARO-HCP/frontend/pkg/config		coverage: 0.0% of statements
	github.com/Azure/ARO-HCP/frontend/cmd		coverage: 0.0% of statements
	github.com/Azure/ARO-HCP/frontend/utils		coverage: 0.0% of statements
{"time":"2025-01-28T12:54:15.228403686Z","level":"ERROR","msg":"error retrieving value from context, value obtained was '<nil>' and type obtained was '*slog.Logger'"}
{"time":"2025-01-28T12:54:15.228567801Z","level":"INFO","msg":"read request","request_method":"PUT","request_path":"/subscriptions/00000000-0000-0000-0000-000000000000","request_proto":"HTTP/1.1","request_query":"api-version=2.0","request_remote_addr":"127.0.0.1:33948","request_user_agent":"Go-http-client/1.1"}
{"time":"2025-01-28T12:54:15.228606082Z","level":"ERROR","msg":"error retrieving value from context, value obtained was '<nil>' and type obtained was '*slog.Logger'"}
{"time":"2025-01-28T12:54:15.228665262Z","level":"ERROR","msg":"error retrieving value from context, value obtained was '<nil>' and type obtained was '*slog.Logger'"}
{"time":"2025-01-28T12:54:15.228814279Z","level":"ERROR","msg":"error retrieving value from context, value obtained was '<nil>' and type obtained was '*slog.Logger'"}
{"time":"2025-01-28T12:54:15.228823837Z","level":"ERROR","msg":"error retrieving value from context, value obtained was '<nil>' and type obtained was '*slog.Logger'"}
{"time":"2025-01-28T12:54:15.228837633Z","level":"ERROR","msg":"error retrieving value from context, value obtained was '<nil>' and type obtained was '<nil>'","request_id":"f38eaa54-6092-497e-80cb-1ba334486a75","client_request_id":"","correlation_request_id":"","subscription_id":"00000000-0000-0000-0000-000000000000"}
{"time":"2025-01-28T12:54:15.228861758Z","level":"INFO","msg":"unable to retrieve subscription document for the `frontend_requests_total` metric","subscriptionId":"00000000-0000-0000-0000-000000000000","error":"not found"}
{"time":"2025-01-28T12:54:15.22901382Z","level":"INFO","msg":"send response","request_method":"PUT","request_path":"/subscriptions/00000000-0000-0000-0000-000000000000","request_proto":"HTTP/1.1","request_query":"api-version=2.0","request_remote_addr":"127.0.0.1:33948","request_user_agent":"Go-http-client/1.1","body_read_bytes":116,"body_written_bytes":107,"response_status_code":500,"duration":0.000451881}
--- FAIL: TestSubscriptionsPUT (0.01s)
    --- FAIL: TestSubscriptionsPUT/PUT_Subscription_-_Doc_does_not_exist (0.00s)
        frontend_test.go:307: expected status code 200, got 500
        controller.go:97: missing call(s) to *mocks.MockDBClient.CreateSubscriptionDoc(is anything, is anything) /home/runner/work/ARO-HCP/ARO-HCP/frontend/pkg/frontend/frontend_test.go:274
        controller.go:97: aborting test due to missing call(s)
2025/01/28 12:54:15 WARN Failed to parse X-Ms-Arm-Resource-System-Data header: invalid character 'i' looking for beginning of value
2025/01/28 12:54:15 ERROR unsupported subscription state "Invalid"
2025/01/28 12:54:15 ERROR error retrieving value from context, value obtained was '<nil>' and type obtained was '<nil>'
FAIL
@frzifus frzifus changed the title frontend: unittest seems to be flaky frontend: ci test seems to be flaky Jan 28, 2025
@mbarnes
Copy link
Collaborator

mbarnes commented Feb 14, 2025

I've seen these unit test flakes before. It may be a panic being masked by the MiddlewarePanic function.

@mbarnes mbarnes self-assigned this Feb 14, 2025
mbarnes pushed a commit that referenced this issue Feb 15, 2025
This effectively disables MiddlewarePanic when running unit tests.

Catching a panic can sometimes obscure the root cause of a test
failure, especially when the panic is intermittent and happens
during a CI pipeline run where there's no opportunity to debug.

This has been observed at least once before in
#833

and may be happening again according to
#1163
mbarnes pushed a commit that referenced this issue Feb 17, 2025
This effectively disables MiddlewarePanic when running unit tests.

Catching a panic can sometimes obscure the root cause of a test
failure, especially when the panic is intermittent and happens
during a CI pipeline run where there's no opportunity to debug.

This has been observed at least once before in
#833

and may be happening again according to
#1163
@mbarnes
Copy link
Collaborator

mbarnes commented Feb 20, 2025

I changed MiddlewarePanic to disable itself when being run through go test. Hopefully this will make the root cause clearer the next time one of us sees it in a CI run.

@frzifus frzifus closed this as completed Feb 21, 2025
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

No branches or pull requests

2 participants