Skip to content

fix(tests): fix flaky initial_size_correct_with_multievents test#25239

Merged
thomasqueirozb merged 2 commits into
vectordotdev:masterfrom
vparfonov:fix-flaky-ledger-lock-test
May 8, 2026
Merged

fix(tests): fix flaky initial_size_correct_with_multievents test#25239
thomasqueirozb merged 2 commits into
vectordotdev:masterfrom
vparfonov:fix-flaky-ledger-lock-test

Conversation

@vparfonov
Copy link
Copy Markdown
Contributor

@vparfonov vparfonov commented Apr 22, 2026

Summary

Replace the one-shot create_default_buffer_v2_with_usage call with retry loop when reopening the buffer. After dropping the first buffer, the background finalizer task may still hold an Arc<Ledger> (and thus the lock file). The retry loop only retries on LedgerLockAlreadyHeld errors — any other error panics immediately to avoid masking real failures. The test framework's own timeout handles truly stuck cases.

Also removes the now-unused create_default_buffer_v2_with_usage helper.

Vector configuration

How did you test this PR?

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@vparfonov vparfonov requested a review from a team as a code owner April 22, 2026 09:33
@thomasqueirozb thomasqueirozb disabled auto-merge April 22, 2026 19:41
@thomasqueirozb thomasqueirozb added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Apr 22, 2026
@pront
Copy link
Copy Markdown
Member

pront commented Apr 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: 50e0f3ee71

ℹ️ 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".

Comment thread lib/vector-buffers/src/variants/disk_v2/tests/basic.rs Outdated
@vparfonov vparfonov force-pushed the fix-flaky-ledger-lock-test branch from 50e0f3e to d9e0ceb Compare April 23, 2026 08:56
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: d9e0ceb076

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread lib/vector-buffers/src/variants/disk_v2/tests/basic.rs Outdated
@vparfonov vparfonov force-pushed the fix-flaky-ledger-lock-test branch from d9e0ceb to e445cf9 Compare April 23, 2026 09:23
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: e445cf9faf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread lib/vector-buffers/src/variants/disk_v2/tests/basic.rs Outdated
@vparfonov vparfonov force-pushed the fix-flaky-ledger-lock-test branch from e445cf9 to e55d500 Compare April 23, 2026 09:41
@vparfonov vparfonov requested a review from pront April 23, 2026 09:58
Copy link
Copy Markdown
Member

@pront pront left a comment

Choose a reason for hiding this comment

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

Thanks, this iteration makes sense to me.

@pront pront enabled auto-merge April 24, 2026 14:06
@pront pront disabled auto-merge April 24, 2026 14:07
Comment thread lib/vector-buffers/src/variants/disk_v2/tests/basic.rs Outdated
@vparfonov vparfonov requested a review from pront April 29, 2026 16:29
Manually construct a write-only `BufferWriter` and `Ledger` during the test setup instead of using `create_default_buffer_v2`.
This prevents spawning a detached background finalizer task, ensuring the `Arc<Ledger>` and file lock are released synchronously
and deterministically when dropped.
@vparfonov vparfonov force-pushed the fix-flaky-ledger-lock-test branch from e55d500 to ecf643f Compare April 30, 2026 06:58
@pront pront enabled auto-merge May 8, 2026 19:24
auto-merge was automatically disabled May 8, 2026 22:18

Head branch was pushed to by a user without write access

@thomasqueirozb thomasqueirozb enabled auto-merge May 8, 2026 22:24
@thomasqueirozb thomasqueirozb added this pull request to the merge queue May 8, 2026
Merged via the queue into vectordotdev:master with commit eda5b86 May 8, 2026
58 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
@vparfonov vparfonov deleted the fix-flaky-ledger-lock-test branch May 10, 2026 14:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog Changes in this PR do not need user-facing explanations in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants