Skip to content

Commit e368abf

Browse files
JaredTan95atoulmecodeboten
authored
[internal/otelarrow] Remove manual time.Sleep call (#42548)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes #42514 <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> Signed-off-by: Jared Tan <[email protected]> Co-authored-by: Antoine Toulme <[email protected]> Co-authored-by: Alex Boten <[email protected]>
1 parent 69f8bff commit e368abf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/otelarrow/admission2/boundedqueue_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ func (bq *bqTest) startWaiter(ctx context.Context, size uint64, relp *ReleaseFun
6767
}
6868

6969
func (bq *bqTest) waitForPending(admitted, waiting uint64) {
70-
// TODO: Remove time.Sleep below, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/42514
71-
time.Sleep(20 * time.Millisecond)
72-
require.Eventually(bq.t, func() bool {
70+
require.EventuallyWithT(bq.t, func(c *assert.CollectT) {
7371
bq.lock.Lock()
7472
defer bq.lock.Unlock()
75-
return bq.currentAdmitted == admitted && bq.currentWaiting == waiting
73+
assert.True(c, bq.currentAdmitted == admitted && bq.currentWaiting == waiting)
7674
}, 10*time.Second, 20*time.Millisecond)
7775
}
7876

0 commit comments

Comments
 (0)