Commit 264bb49d authored by ysaito1001's avatar ysaito1001
Browse files

Test available permits are constant for unlimited TokenBucket

parent cf71d46a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -157,6 +157,11 @@ mod tests {
            let permit = bucket.acquire(&ErrorKind::ThrottlingError);
            assert!(permit.is_some());
            permits.push(permit);
            // Available permits should stay constant
            assert_eq!(
                tokio::sync::Semaphore::MAX_PERMITS,
                bucket.semaphore.available_permits()
            );
        }
    }