Skip to content

fix: close dead-letter/stats read race in codel tests#457

Merged
pratyush618 merged 1 commit into
masterfrom
fix/codel-test-race
Jul 19, 2026
Merged

fix: close dead-letter/stats read race in codel tests#457
pratyush618 merged 1 commit into
masterfrom
fix/codel-test-race

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

The CoDel shed test polls deadLetters then stats non-atomically; a job shed between the two reads satisfies the exit condition (completed + dead == total) with a stale CoDel count, failing stats.dead == codelDead (seen on CI: expected 19 to be 18). Once converged nothing moves, so each test now rereads dead letters after the loop for the settled count. Same fix applied in all three SDK suites.

Testing

  • Node: vitest run test/core/codel.test.ts — 2 passed; biome + tsc clean
  • Python: pytest tests/core/test_codel.py — 3 passed; ruff + mypy clean
  • Java: gradlew :test --tests CodelTest — 3 passed

Summary by CodeRabbit

  • Tests
    • Improved cross-language CoDel overload test stability by refreshing dead-letter results after queue processing reaches a settled state.
    • Reduced timing-related inconsistencies in assertions involving completed and dead-lettered jobs.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 062d4484-8b51-45a0-b563-aa3e6946940e

📥 Commits

Reviewing files that changed from the base of the PR and between 9118d63 and 9e71041.

📒 Files selected for processing (3)
  • sdks/java/src/test/java/org/byteveda/taskito/core/CodelTest.java
  • sdks/node/test/core/codel.test.ts
  • sdks/python/tests/core/test_codel.py

📝 Walkthrough

Walkthrough

CoDel overload tests in the Java, Node.js, and Python SDKs now refresh dead-letter snapshots after job-state convergence before asserting the number of CoDel-shed jobs.

Changes

CoDel test convergence

Layer / File(s) Summary
Refresh dead-letter snapshots after convergence
sdks/java/.../CodelTest.java, sdks/node/test/core/codel.test.ts, sdks/python/tests/core/test_codel.py
The tests re-read dead-letter entries after convergence and recompute CoDel-related counts for the final assertions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • ByteVeda/taskito#450: Updates the CoDel overload end-to-end tests with post-convergence dead-letter queue reads.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the core fix: resolving the dead-letter/stats read race in CoDel tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/codel-test-race

Comment @coderabbitai help to get the list of available commands.

The poll loop read dead letters before stats, so a job shed between
the two reads left a stale count when the exit condition fired.
@pratyush618
pratyush618 force-pushed the fix/codel-test-race branch from 956e49d to 9e71041 Compare July 19, 2026 02:52
@pratyush618
pratyush618 merged commit 63b6d74 into master Jul 19, 2026
27 checks passed
@pratyush618
pratyush618 deleted the fix/codel-test-race branch July 19, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant