netresearch
go-cron
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix: suppress gosec G118 false positives and stabilize flaky tests - Add //nolint:gosec comments for G118 (context cancel not called) on 4 sites where the cancel func is stored in a struct field and called later (New, scheduleJob, updateEntry, Stop). - Fix TestAddWhileRunningWithDelay: convert from real time to FakeClock for deterministic behavior (was flaky near second boundaries). - Fix TestBlockingRun: convert from real time to FakeClock for deterministic behavior (was flaky under load). Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de> Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
test/pr336-deep-copy-and-race-tests
21 days ago
fix(cron): avoid race condition in Entry/EntryByName and ScheduleJob (#336) ## Description Replace manual mutex unlock calls with defer to ensure the lock is always released, even when returning early from the function. For Entry/EntryByName: The original code unlocked runningMu before the channel send/receive completed, allowing concurrent access to entry maps while they were being modified. For ScheduleJob: The original code modified entryIndex/nameIndex and heap directly while the run loop's Ticker could fire concurrently. The Ticker fires based on the next scheduled job time, so adding a new job may require rescheduling the Ticker. Modifying the heap from both goroutines caused a race condition. By routing ScheduleJob through the c.add channel when running, all heap/map modifications happen atomically in the run loop, preventing concurrent access with the Ticker. Brief description of the changes. ## Type of Change - [x] Bug fix (non-breaking change fixing an issue) ## Checklist - [x] My code follows the project's coding standards - [x] I have run `make verify` and all checks pass - [x] I have added tests covering my changes - [x] I have updated documentation as needed - [x] My commits follow conventional commit format ## Testing Describe how you tested these changes. `make test`
main
21 days ago
fix(cron): deep copy Entry.Tags to prevent external mutation Add Entry.copy() method that clones the Tags slice using slices.Clone. This prevents callers from modifying internal cron state through the returned Entry structs in Entry(), EntryByName(), Entries(), and the run loop's lookup handlers.
jrouzierinverse:fix/race-conditions
24 days ago
fix(cron): deep copy Entry.Tags to prevent external mutation Add Entry.copy() method that clones the Tags slice using slices.Clone. This prevents callers from modifying internal cron state through the returned Entry structs in Entry(), EntryByName(), Entries(), and the run loop's lookup handlers.
jrouzierinverse:fix/race-conditions
24 days ago
fix(cron): deep copy Entry.Tags to prevent external mutation Add Entry.copy() method that clones the Tags slice using slices.Clone. This prevents callers from modifying internal cron state through the returned Entry structs in Entry(), EntryByName(), Entries(), and the run loop's lookup handlers.
jrouzierinverse:fix/race-conditions
24 days ago
fix(test): widen timing tolerance for MaxDelay test on macOS (#340) ## Summary - Widen timing tolerance in `TestRetryWithBackoff_MaxDelayRespected` from 1.5x to 5x - Fixes intermittent failure on macOS CI runners due to scheduling jitter ## Test plan - [x] Local tests pass with `-count=5` - [ ] CI passes on all platforms including macOS
main
29 days ago
fix(test): widen timing tolerance for MaxDelay test on macOS TestRetryWithBackoff_MaxDelayRespected fails intermittently on macOS CI runners due to scheduling jitter. Widen tolerance from 1.5x to 5x maxDelay to accommodate high-variance CI environments while still validating the backoff cap behavior. Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de> Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
fix/macos-timing-test
29 days ago
chore: add SPDX headers and DCO enforcement (#339) ## Summary - Add SPDX copyright and MIT license headers to all 44 Go source files - Add DCO enforcement via lefthook hooks (auto sign-off + verification) - Supports OpenSSF Best Practices Silver/Gold badge criteria ## Test plan - [ ] Verify SPDX headers present in Go files - [ ] Verify lefthook DCO hooks work
main
1 month ago
Latest Branches
CodSpeed Performance Gauge
-75%
test: add tests for PR #336 and fix pre-existing lint/flaky issues
#341
21 days ago
41e1bc6
test/pr336-deep-copy-and-race-tests
CodSpeed Performance Gauge
-34%
fix(cron): avoid race condition in Entry/EntryByName and ScheduleJob
#336
24 days ago
ccea108
jrouzierinverse:fix/race-conditions
CodSpeed Performance Gauge
-53%
fix(test): widen timing tolerance for MaxDelay test on macOS
#340
29 days ago
912f601
fix/macos-timing-test
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs