diff --git a/swarm/storage/feed/lookup/lookup_test.go b/swarm/storage/feed/lookup/lookup_test.go index dc4377156c..b5d1a3b0ba 100644 --- a/swarm/storage/feed/lookup/lookup_test.go +++ b/swarm/storage/feed/lookup/lookup_test.go @@ -41,7 +41,7 @@ const enablePrintMetrics = false // set to true to display algorithm benchmarkin func printMetric(metric string, store *Store, elapsed time.Duration) { if enablePrintMetrics { fmt.Printf("metric=%s, readcount=%d (successful=%d, failed=%d), cached=%d, canceled=%d, maxSimult=%d, elapsed=%s\n", metric, - store.reads, store.sucessful, store.failed, store.cacheHits, store.canceled, store.maxSimultaneous, elapsed) + store.reads, store.successful, store.failed, store.cacheHits, store.canceled, store.maxSimultaneous, elapsed) } } diff --git a/swarm/storage/feed/lookup/store_test.go b/swarm/storage/feed/lookup/store_test.go index 148034687a..ed52093191 100644 --- a/swarm/storage/feed/lookup/store_test.go +++ b/swarm/storage/feed/lookup/store_test.go @@ -42,7 +42,7 @@ type StoreCounters struct { reads int cacheHits int failed int - sucessful int + successful int canceled int maxSimultaneous int } @@ -122,7 +122,7 @@ func (s *Store) Get(ctx context.Context, epoch lookup.Epoch, now uint64) (value if item != nil { s.cacheHits++ if item.Time <= now { - s.sucessful++ + s.successful++ return item, nil } return nil, nil @@ -133,7 +133,7 @@ func (s *Store) Get(ctx context.Context, epoch lookup.Epoch, now uint64) (value item = s.data[epochID] if item != nil { operationTime += s.SuccessfulReadTime - s.sucessful++ + s.successful++ s.cache[epochID] = item if item.Time <= now { return item, nil diff --git a/swarm/storage/feed/lookup/timesim_test.go b/swarm/storage/feed/lookup/timesim_test.go index b15fc820db..2a254188cc 100644 --- a/swarm/storage/feed/lookup/timesim_test.go +++ b/swarm/storage/feed/lookup/timesim_test.go @@ -58,9 +58,9 @@ func (s *Stopwatch) Tick() { } } -// GetTimer returns a new timer that will trigger after `duration` elapses in the +// NewTimer returns a new timer that will trigger after `duration` elapses in the // simulation -func (s *Stopwatch) GetTimer(duration time.Duration) <-chan time.Time { +func (s *Stopwatch) NewTimer(duration time.Duration) <-chan time.Time { s.lock.Lock() defer s.lock.Unlock() @@ -78,7 +78,7 @@ func (s *Stopwatch) GetTimer(duration time.Duration) <-chan time.Time { // TimeAfter returns a simulated timer factory that can replace `time.After` func (s *Stopwatch) TimeAfter() func(d time.Duration) <-chan time.Time { return func(d time.Duration) <-chan time.Time { - return s.GetTimer(d) + return s.NewTimer(d) } }