Skip to content

shared/logs: deflake follow handoff ordering tests#972

Open
amirHdev wants to merge 2 commits intokubetail-org:mainfrom
amirHdev:fix-shared-logs-follow-order-test-flake
Open

shared/logs: deflake follow handoff ordering tests#972
amirHdev wants to merge 2 commits intokubetail-org:mainfrom
amirHdev:fix-shared-logs-follow-order-test-flake

Conversation

@amirHdev
Copy link
Copy Markdown
Contributor

This PR fixes an intermittent test failure in modules/shared/logs seen in PR checks where follow-mode records from different sources can arrive in either order around the past-to-follow handoff.

Fixes #696

Changes

  • Updates TestStreamAllWithFollow and TestStreamTailWithFollow to avoid assuming a strict cross-source ordering for concurrent follow records
  • Keeps deterministic assertions for the past-data portion of each test
  • Allows either valid ordering for the final follow records (s1-* / s2-*) in the affected handoff scenarios

Why

  • The stream implementation runs past and follow fetchers concurrently
  • At the handoff boundary, goroutine scheduling can change the arrival order of cross-source follow records
  • The previous assertions were too strict and caused flaky CI failures

Validation

  • Re-ran affected tests repeatedly:
    • go test ./shared/logs -run 'TestStream(All|Tail)WithFollow' -count=50 (from modules/)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58680a8d2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@amirHdev amirHdev force-pushed the fix-shared-logs-follow-order-test-flake branch 2 times, most recently from 07b5c30 to e746abf Compare February 22, 2026 17:33
@amorey
Copy link
Copy Markdown
Member

amorey commented Feb 22, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e746abf83b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- relax shared/logs follow tests to allow valid cross-source ordering at the past-to-follow handoff

- accept the expected UNAVAILABLE shutdown status in cluster_agent watcher tests after cancellation instead of assuming try_recv() is always empty

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
@amirHdev amirHdev force-pushed the fix-shared-logs-follow-order-test-flake branch from e746abf to 392604a Compare February 22, 2026 18:11
@amirHdev
Copy link
Copy Markdown
Contributor Author

@codex review

can we review it again ?

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@amorey
Copy link
Copy Markdown
Member

amorey commented Feb 23, 2026

The Rust and Go changes are independent and should be split into separate PRs.

In terms of the Rust code, which test/issue is this designed to fix?

In terms of the Go code, the proposed changes are changing the tests for certain specific test cases (as @codex pointed out). If that is the best solution then those cases should be moved to their own separate functions but the PR description needs to fully document why the checks can be relaxed.

Also here's our PR tempalte and suggested commit format:
https://github.com/kubetail-org/kubetail/blob/main/.github/pull_request_template.md
https://github.com/kubetail-org/.github/blob/main/pull-request-commit-format.md

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex couldn't complete this request. Try again later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Intermittent test failure

2 participants