(t *testing.T)
| 485 | } |
| 486 | |
| 487 | func TestAsyncBufferThresholdInstantBeyondAccess(t *testing.T) { |
| 488 | _, bytesReader := generateSourceData(t, asyncbuffer.PauseThreshold*3) |
| 489 | ab := asyncbuffer.New(bytesReader, -1) |
| 490 | defer ab.Close() |
| 491 | |
| 492 | target := make([]byte, asyncbuffer.ChunkSize) |
| 493 | n, err := ab.ReadAt(target, asyncbuffer.PauseThreshold+1) |
| 494 | require.NoError(t, err) |
| 495 | assert.GreaterOrEqual(t, asyncbuffer.ChunkSize, n) |
| 496 | |
| 497 | // Ensure that buffer hits the end of the stream |
| 498 | require.Eventually(t, func() bool { |
| 499 | return bytesReader.BytesRead() >= asyncbuffer.PauseThreshold*2 |
| 500 | }, 300*time.Millisecond, 10*time.Millisecond) |
| 501 | } |
nothing calls this directly
no test coverage detected