Skip to content

fix: flaky integration tests due to Gitea post-receive hook 500 errors #5413

Description

@markphelps

Summary

The environment integration tests (envs and envs/dir) are intermittently failing due to Gitea post-receive hook 500 errors. This causes Flipt to not see newly pushed flags/namespaces, resulting in "not found" errors in the test assertions.

Symptoms

  • Gitea logs show repeated 500 Internal Server Error responses for POST /api/internal/hook/post-receive/root/features
  • Tests fail with errors like:
    • rpc error: code = NotFound desc = flag "default/test" not found
    • rpc error: code = NotFound desc = namespace "alternative" not found
  • Failures occur in TestAPI/env_"production" for both namespace_"default" and namespace_"alternative" subtests
  • Failure location: build/testing/integration/environments/api_test.go:200

Observed across branches

  • feat/aws-secrets-manager (multiple runs)
  • rd/v2/grpc-bump

This is not related to any specific feature change — it's a test infrastructure issue.

Possible fixes

  • Add retry/polling logic when waiting for Gitea post-receive hooks to complete before asserting on flag/namespace existence
  • Increase wait time or add explicit sync check after git push operations in the test setup
  • Investigate why Gitea's post-receive hook intermittently returns 500

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions