@@ -1426,22 +1426,22 @@ func TestScheduler_OneTimeJob_DoesNotCleanupNext(t *testing.T) {
14261426 tests := []struct {
14271427 name string
14281428 runAt time.Time
1429- fakeClock clockwork.FakeClock
1429+ fakeClock * clockwork.FakeClock
14301430 assertErr require.ErrorAssertionFunc
14311431 // asserts things about schedules, advance time and perform new assertions
14321432 advanceAndAsserts []func (
14331433 t * testing.T ,
14341434 j Job ,
1435- clock clockwork.FakeClock ,
1435+ clock * clockwork.FakeClock ,
14361436 runs * atomic.Uint32 ,
14371437 )
14381438 }{
14391439 {
14401440 name : "exhausted run do does not cleanup next item" ,
14411441 runAt : time .Date (2024 , time .April , 22 , 4 , 5 , 0 , 0 , time .UTC ),
14421442 fakeClock : clockwork .NewFakeClockAt (schedulerStartTime ),
1443- advanceAndAsserts : []func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ){
1444- func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ) {
1443+ advanceAndAsserts : []func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ){
1444+ func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ) {
14451445 require .Equal (t , uint32 (0 ), runs .Load ())
14461446
14471447 // last not initialized
@@ -2377,13 +2377,13 @@ func TestScheduler_AtTimesJob(t *testing.T) {
23772377 tests := []struct {
23782378 name string
23792379 atTimes []time.Time
2380- fakeClock clockwork.FakeClock
2380+ fakeClock * clockwork.FakeClock
23812381 assertErr require.ErrorAssertionFunc
23822382 // asserts things about schedules, advance time and perform new assertions
23832383 advanceAndAsserts []func (
23842384 t * testing.T ,
23852385 j Job ,
2386- clock clockwork.FakeClock ,
2386+ clock * clockwork.FakeClock ,
23872387 runs * atomic.Uint32 ,
23882388 )
23892389 }{
@@ -2407,8 +2407,8 @@ func TestScheduler_AtTimesJob(t *testing.T) {
24072407 name : "one run 1 millisecond in the future" ,
24082408 atTimes : []time.Time {n .Add (1 * time .Millisecond )},
24092409 fakeClock : clockwork .NewFakeClockAt (n ),
2410- advanceAndAsserts : []func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ){
2411- func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ) {
2410+ advanceAndAsserts : []func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ){
2411+ func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ) {
24122412 require .Equal (t , uint32 (0 ), runs .Load ())
24132413
24142414 // last not initialized
@@ -2442,8 +2442,8 @@ func TestScheduler_AtTimesJob(t *testing.T) {
24422442 name : "one run in the past and one in the future" ,
24432443 atTimes : []time.Time {n .Add (- 1 * time .Millisecond ), n .Add (1 * time .Millisecond )},
24442444 fakeClock : clockwork .NewFakeClockAt (n ),
2445- advanceAndAsserts : []func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ){
2446- func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ) {
2445+ advanceAndAsserts : []func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ){
2446+ func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ) {
24472447 require .Equal (t , uint32 (0 ), runs .Load ())
24482448
24492449 // last not initialized
@@ -2473,8 +2473,8 @@ func TestScheduler_AtTimesJob(t *testing.T) {
24732473 name : "two runs in the future - order is maintained even if times are provided out of order" ,
24742474 atTimes : []time.Time {n .Add (3 * time .Millisecond ), n .Add (1 * time .Millisecond )},
24752475 fakeClock : clockwork .NewFakeClockAt (n ),
2476- advanceAndAsserts : []func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ){
2477- func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ) {
2476+ advanceAndAsserts : []func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ){
2477+ func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ) {
24782478 require .Equal (t , uint32 (0 ), runs .Load ())
24792479
24802480 // last not initialized
@@ -2503,7 +2503,7 @@ func TestScheduler_AtTimesJob(t *testing.T) {
25032503 require .Equal (t , n .Add (3 * time .Millisecond ), nextRunAt )
25042504 },
25052505
2506- func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ) {
2506+ func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ) {
25072507 // advance and eventually run
25082508 clock .Advance (2 * time .Millisecond )
25092509 require .Eventually (t , func () bool {
@@ -2526,8 +2526,8 @@ func TestScheduler_AtTimesJob(t *testing.T) {
25262526 name : "two runs in the future - order is maintained even if times are provided out of order - deduplication" ,
25272527 atTimes : []time.Time {n .Add (3 * time .Millisecond ), n .Add (1 * time .Millisecond ), n .Add (1 * time .Millisecond ), n .Add (3 * time .Millisecond )},
25282528 fakeClock : clockwork .NewFakeClockAt (n ),
2529- advanceAndAsserts : []func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ){
2530- func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ) {
2529+ advanceAndAsserts : []func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ){
2530+ func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ) {
25312531 require .Equal (t , uint32 (0 ), runs .Load ())
25322532
25332533 // last not initialized
@@ -2556,7 +2556,7 @@ func TestScheduler_AtTimesJob(t *testing.T) {
25562556 require .Equal (t , n .Add (3 * time .Millisecond ), nextRunAt )
25572557 },
25582558
2559- func (t * testing.T , j Job , clock clockwork.FakeClock , runs * atomic.Uint32 ) {
2559+ func (t * testing.T , j Job , clock * clockwork.FakeClock , runs * atomic.Uint32 ) {
25602560 // advance and eventually run
25612561 clock .Advance (2 * time .Millisecond )
25622562 require .Eventually (t , func () bool {
0 commit comments