Skip to content

Conversation

@hyp3rd
Copy link
Owner

@hyp3rd hyp3rd commented Jan 25, 2026

Add a retention stress test ensuring the task registry is pruned down to MaxEntries after tasks reach terminal states. Update README to clarify retention semantics (only terminal tasks are evicted), best-effort cleanup timing, and the default CleanupInterval behavior.

Add a retention stress test ensuring the task registry is pruned down to MaxEntries after tasks reach terminal states.
Update README to clarify retention semantics (only terminal tasks are evicted), best-effort cleanup timing, and the default CleanupInterval behavior.
Copilot AI review requested due to automatic review settings January 25, 2026 09:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a stress test to verify that the task registry enforces MaxEntries under higher load and clarifies retention semantics and behavior in the README.

Changes:

  • Add TestTaskManager_RetentionMaxEntriesUnderLoad to ensure the registry is pruned down to MaxEntries after tasks reach terminal states, even under higher throughput and larger max task limits.
  • Introduce load-specific retention constants in the worker tests (retentionLoadTasks, retentionLoadMaxEntries, retentionLoadMaxTasks).
  • Document retention semantics in the README, including which tasks are eligible for eviction, cleanup timing, and the default CleanupInterval behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/worker_test.go Adds a high-load retention test and supporting constants to validate MaxEntries pruning and terminal-state-only retention logic.
README.md Expands documentation of retention semantics, cleanup behavior, and default CleanupInterval computation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tm.SetRetentionPolicy(worker.RetentionPolicy{MaxEntries: retentionLoadMaxEntries})

tasks := make([]*worker.Task, 0, retentionLoadTasks)
for range retentionLoadTasks {
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

The for range retentionLoadTasks loop is invalid because retentionLoadTasks is an int constant, so this code will not compile. Use an index-based loop (or create the slice with a fixed length and index into it) to append retentionLoadTasks items to the tasks slice.

Suggested change
for range retentionLoadTasks {
for i := 0; i < retentionLoadTasks; i++ {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants