Skip to content

Commit

Permalink
Merge branch 'main' into fix/avoid-log-floats
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanosiano authored Jan 22, 2025
2 parents dcf8e00 + 926429a commit 4d7e996
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

## 8.0.0

### Summary

Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:

- `Hub` has been replaced by `Scopes`
Expand Down
15 changes: 8 additions & 7 deletions sentry/src/test/java/io/sentry/transport/RateLimiterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.whenever
import java.io.File
import java.util.UUID
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down Expand Up @@ -363,18 +365,17 @@ class RateLimiterTest {
val rateLimiter = fixture.getSUT()
whenever(fixture.currentDateProvider.currentTimeMillis).thenReturn(0, 1, 2001)

val applied = AtomicBoolean(true)
val applied = CountDownLatch(1)
var activeForReplay = false
rateLimiter.addRateLimitObserver {
applied.set(rateLimiter.isActiveForCategory(Replay))
applied.countDown()
activeForReplay = rateLimiter.isActiveForCategory(Replay)
}

rateLimiter.updateRetryAfterLimits("1:replay:key", null, 1)
rateLimiter.close()

// If rate limit didn't already change, wait for 1.5s to ensure the timer has run after 1s
if (!applied.get()) {
await.untilTrue(applied)
}
assertTrue(applied.get())
applied.await(2, TimeUnit.SECONDS)
assertTrue(activeForReplay)
}
}

0 comments on commit 4d7e996

Please sign in to comment.