@@ -415,23 +415,23 @@ func TestRefreshIfModifiedAfter(t *testing.T) {
415415
416416 // 1. Entry does not exist, should load synchronously.
417417 wg .Add (1 )
418- c .RefreshIfModifiedAfter (key , mockTime .now ())
418+ c .RefreshIfModifiedAfter (key , mockTime .now (). UnixNano () )
419419 wg .Wait ()
420420
421421 if loadCount != 1 {
422422 t .Fatalf ("expected loadCount to be 1 after initial load, got %d" , loadCount )
423423 }
424424
425425 // 2. Entry exists, but modifiedTime is not after entry's write time. Should not refresh.
426- c .RefreshIfModifiedAfter (key , mockTime .now ().Add (- 1 * time .Millisecond )) // modified time is before write time
426+ c .RefreshIfModifiedAfter (key , mockTime .now ().Add (- 1 * time .Millisecond ). UnixNano () ) // modified time is before write time
427427 // No wg.Add/Wait as it should be synchronous and do nothing.
428428 if loadCount != 1 {
429429 t .Fatalf ("expected loadCount to be 1 when not modified, got %d" , loadCount )
430430 }
431431
432432 // 3. Entry exists, and modifiedTime is after entry's write time. Should refresh.
433433 wg .Add (1 )
434- c .RefreshIfModifiedAfter (key , mockTime .now ().Add (1 * time .Millisecond )) // modified time is after write time
434+ c .RefreshIfModifiedAfter (key , mockTime .now ().Add (1 * time .Millisecond ). UnixNano () ) // modified time is after write time
435435 wg .Wait ()
436436 if loadCount != 2 {
437437 t .Fatalf ("expected loadCount to be 2 after refresh, got %d" , loadCount )
@@ -448,14 +448,14 @@ func TestRefreshIfModifiedAfter(t *testing.T) {
448448 t .Fatalf ("unexpected get: %v %v" , v , err )
449449 }
450450
451- c .RefreshIfModifiedAfter (key2 , mockTime .now ()) // modified time is the same as write time
451+ c .RefreshIfModifiedAfter (key2 , mockTime .now (). UnixNano () ) // modified time is the same as write time
452452 // No wg.Add/Wait as it should be synchronous and do nothing.
453453 if loadCount != 2 {
454454 t .Fatalf ("expected loadCount to be 2 when not modified, got %d" , loadCount )
455455 }
456456
457457 wg .Add (1 )
458- c .RefreshIfModifiedAfter (key , mockTime .now ().Add (1 * time .Millisecond )) // modified time is after write time
458+ c .RefreshIfModifiedAfter (key , mockTime .now ().Add (1 * time .Millisecond ). UnixNano () ) // modified time is after write time
459459 wg .Wait ()
460460 if loadCount != 3 {
461461 t .Fatalf ("expected loadCount to be 3 after refresh, got %d" , loadCount )
0 commit comments