Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonLewis committed May 17, 2024
1 parent 441e051 commit 14d84a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions datasync/downloader/downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,6 @@ func testBoundedForkedSync(t *testing.T, protocol int, mode SyncMode) {
}

func testBoundedForkedSync65FastOnKaia(t *testing.T, protocol int, mode SyncMode) {
t.Parallel()

originalKaiaFork := kaiaCompatibleBlock
originalStakingUpdateInterval := testStakingUpdateInterval
kaiaCompatibleBlock = big.NewInt(0)
Expand Down
8 changes: 4 additions & 4 deletions datasync/downloader/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func testEmptyBlocks(t *testing.T, kaiaFork bool) {

numOfBlocks := len(emptyChain.blocks)
numOfStakingInfos := len(chain.stakingInfos) / 4
effectiveStakingInterval := 4
effectiveStakingInterval := testInterval
config := params.TestChainConfig
if kaiaFork {
numOfStakingInfos = len(chain.stakingInfos)
Expand Down Expand Up @@ -414,7 +414,7 @@ func testEmptyBlocks(t *testing.T, kaiaFork bool) {
t.Fatal("should throttle")
}
// But we should still get the first things to fetch
if got, exp := len(fetchReq.Headers), (10 / effectiveStakingInterval); got != exp {
if got, exp := len(fetchReq.Headers), int(10/effectiveStakingInterval); got != exp {
t.Fatalf("expected %d requests, got %d", exp, got)
}
if got, exp := fetchReq.Headers[0].Number.Uint64(), uint64(effectiveStakingInterval); got != exp {
Expand All @@ -427,10 +427,10 @@ func testEmptyBlocks(t *testing.T, kaiaFork bool) {
if q.receiptTaskQueue.Size() != 0 {
t.Errorf("expected receipt task queue to be %d, got %d", 0, q.receiptTaskQueue.Size())
}
if got, exp := q.stakingInfoTaskQueue.Size(), numOfStakingInfos-(10/effectiveStakingInterval); got != exp {
if got, exp := q.stakingInfoTaskQueue.Size(), numOfStakingInfos-int(10/effectiveStakingInterval); got != exp {
t.Fatalf("expected staking info task queue size %d, got %d", exp, got)
}
if got, exp := q.resultCache.countCompleted(), (effectiveStakingInterval - 1); got != exp {
if got, exp := q.resultCache.countCompleted(), int(effectiveStakingInterval-1); got != exp {
t.Errorf("wrong processable count, got %d, exp %d", got, exp)
}
}
Expand Down

0 comments on commit 14d84a7

Please sign in to comment.