Files
seaweedfs/weed/admin
Chris LuandGitHub cba2e5150c plugin: fix flaky scheduler lock test (#10432)
plugin: stop the scheduler lock test racing its own background loops

TestRunLaneSchedulerIterationLockBehavior constructed the plugin with a
cluster-context provider, which makes New start a background scheduler
loop per lane. Those loops call runLaneSchedulerIteration on the same
lane the test then drives by hand, so a loop could consume the due job —
running detection and pushing the next-detection time forward — before
the manual call observed the lock. The Default case then saw the lock
acquired zero times and failed intermittently.

Construct without the provider so no loops start, and set the provider
afterward so the manual iteration can still detect. This is the pattern
scheduler_status_test.go already uses for the same reason.

Reproduced under -race -count=100 -p 4 before, green after.

Claude-Session: https://claude.ai/code/session_01Ks16jnt4S7gdDk8cheQ3xu
2026-07-24 17:51:33 -07:00
..