Skip to content

Commit

Permalink
use noopn logger
Browse files Browse the repository at this point in the history
  • Loading branch information
danwt committed Aug 9, 2024
1 parent 01fc2d5 commit d73527a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions block/submit_loop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func testSubmitLoopInner(
}
// producer shall not get too far ahead
absoluteMax := (args.batchSkew + 1) * args.batchBytes // +1 is because the producer is always blocked after the fact
require.True(t, nProducedBytes.Load() < absoluteMax)
nProduced := nProducedBytes.Load()
require.True(t, nProduced < absoluteMax, "produced bytes not less than maximum", "nProduced", nProduced, "max", absoluteMax)
}
}()
for {
Expand Down Expand Up @@ -99,13 +100,14 @@ func testSubmitLoopInner(

timeLastProgressT := time.Unix(timeLastProgress.Load(), 0)
absoluteMax := int64(1.5 * float64(args.maxTime)) // allow some leeway for code execution
require.True(t, time.Since(timeLastProgressT).Milliseconds() < absoluteMax)
timeSinceLast := time.Since(timeLastProgressT).Milliseconds()
require.True(t, timeSinceLast < absoluteMax, "too long since last update", "timeSinceLast", timeSinceLast, "max", absoluteMax)

timeLastProgress.Store(time.Now().Unix()) // we have submitted batch
return uint64(consumed), nil
}

block.SubmitLoopInner(ctx, log.TestingLogger(), producedBytesC, args.batchSkew, args.maxTime, args.batchBytes, submitBatch)
block.SubmitLoopInner(ctx, log.NewNopLogger(), producedBytesC, args.batchSkew, args.maxTime, args.batchBytes, submitBatch)
}

// Make sure the producer does not get too far ahead
Expand Down

0 comments on commit d73527a

Please sign in to comment.