Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzmauro committed Nov 20, 2024
1 parent b8237b9 commit 21a8c3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion splitio/proxy/caching/workers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package caching

import (
"fmt"

"github.com/splitio/go-split-commons/v6/dtos"
"github.com/splitio/go-split-commons/v6/flagsets"
"github.com/splitio/go-split-commons/v6/healthcheck/application"
Expand Down Expand Up @@ -206,7 +208,8 @@ func (c *CacheAwareLargeSegmentSynchronizer) SynchronizeLargeSegments() (map[str
}

func (c *CacheAwareLargeSegmentSynchronizer) shouldEvictBySurrogate(name string, previousCN int64, currentCN int64) {
if currentCN > previousCN || (previousCN > 0 && currentCN == -1) {
if currentCN > previousCN || currentCN == -1 {
fmt.Println("aca")
c.cacheFlusher.EvictBySurrogate(MakeSurrogateForLargeSegmentChanges(name))
}
}
Expand Down
4 changes: 2 additions & 2 deletions splitio/proxy/caching/workers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ func TestSynchronizeLargeSegments(t *testing.T) {
var cn1 int64 = 100
var cn2 int64 = 200
var largeSegmentStorage mocks.LargeSegmentStorageMock
largeSegmentStorage.On("ChangeNumber", "ls1").Return(cn1).Once()
largeSegmentStorage.On("ChangeNumber", "ls2").Return(cn2).Once()
largeSegmentStorage.On("ChangeNumber", "ls1").Return(cn1 - 50).Once()
largeSegmentStorage.On("ChangeNumber", "ls2").Return(cn2 - 50).Once()

var lsUpdater mocks.LargeSegmentUpdaterMock
result := map[string]*int64{
Expand Down

0 comments on commit 21a8c3f

Please sign in to comment.