Skip to content

test(git): remove network and git layout dependencies - #3197

Open
CAOShurong wants to merge 1 commit into
guacsec:mainfrom
CAOShurong:codex/2930-stabilize-git-collector-test
Open

test(git): remove network and git layout dependencies#3197
CAOShurong wants to merge 1 commit into
guacsec:mainfrom
CAOShurong:codex/2930-stabilize-git-collector-test

Conversation

@CAOShurong

Copy link
Copy Markdown

Description of the PR

This removes two sources of nondeterminism from the Git collector test:

  • build a two-document Git fixture in a temporary local repository instead of cloning GitHub;
  • assert only the known fixture documents instead of depending on the number of .git implementation files;
  • stop the polling case as soon as both fixture documents arrive, with a 10-second safety timeout.

A recent integration run (32978753396, job 98209847685) timed out after collecting 0 files. On the current base, the polling subtest also failed 20/20 local runs because the checkout contained 10 files while the test hard-coded 9. The updated test passed 50 consecutive runs.

This addresses one source of the integration-test flakiness tracked in #2930. It intentionally does not change production collector behavior.

Validation

  • go test ./pkg/handler/collector/git -count=50
  • git diff HEAD^ HEAD --check

The broader collector suite still has pre-existing Windows-only path-separator failures in the file collector tests; those reproduce unchanged on the base commit and are outside this PR.

Implementation and investigation were assisted by OpenAI Codex. I reviewed the diff and ran the validation above.

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- generated using git commit -s.
  • All new changes are covered by tests
  • GraphQL schema is unchanged
  • OpenAPI spec is unchanged
  • ent schema is unchanged
  • collectsub protobuf is unchanged
  • All CI checks are passing (awaiting CI)
  • There are no dependent PRs

Signed-off-by: CAOShurong <170531907+CAOShurong@users.noreply.github.com>
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.

2 participants