Debian Codegraph @

debian/patches/01-fix-tests-on-32bit-arch.patch

raw symbols SCIP
1 Descriptionscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/patches/`01-fix-tests-on-32bit-arch.patch`#Description.: Fix tests failing on 32bit arches
2 Authorscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/patches/`01-fix-tests-on-32bit-arch.patch`#Author.: Aloïs Micard <[email protected]scip-debian . . . identity/`[email protected]`.>
3 Reviewed-byscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/patches/`01-fix-tests-on-32bit-arch.patch`#Reviewed-by.: Aloïs Micard <[email protected]>
4 Last-Updatescip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/patches/`01-fix-tests-on-32bit-arch.patch`#Last-Update.: 2024-09-01
5
6 --- a/limiter_atomic.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`limiter_atomic.go`:
7 +++ b/limiter_atomic.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`limiter_atomic.go`:
8 @@ -44,7 +44,7 @@
9 }
10
11 // newAtomicBased returns a new atomic based limiter.
12 -func newAtomicBased(rate int, opts ...Option) *atomicLimiter {
13 +func newAtomicBased(rate int64, opts ...Option) *atomicLimiter {
14 // TODO consider moving config building to the implementation
15 // independent code.
16 config := buildConfig(opts)
17 --- a/limiter_atomic_int64.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`limiter_atomic_int64.go`:
18 +++ b/limiter_atomic_int64.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`limiter_atomic_int64.go`:
19 @@ -39,7 +39,7 @@
20 }
21
22 // newAtomicBased returns a new atomic based limiter.
23 -func newAtomicInt64Based(rate int, opts ...Option) *atomicInt64Limiter {
24 +func newAtomicInt64Based(rate int64, opts ...Option) *atomicInt64Limiter {
25 // TODO consider moving config building to the implementation
26 // independent code.
27 config := buildConfig(opts)
28 --- a/limiter_mutexbased.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`limiter_mutexbased.go`:
29 +++ b/limiter_mutexbased.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`limiter_mutexbased.go`:
30 @@ -35,7 +35,7 @@
31 }
32
33 // newMutexBased returns a new mutex based limiter.
34 -func newMutexBased(rate int, opts ...Option) *mutexLimiter {
35 +func newMutexBased(rate int64, opts ...Option) *mutexLimiter {
36 // TODO consider moving config building to the implementation
37 // independent code.
38 config := buildConfig(opts)
39 --- a/ratelimit_test.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`ratelimit_test.go`:
40 +++ b/ratelimit_test.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`ratelimit_test.go`:
41 @@ -13,7 +13,7 @@
42
43 type testRunner interface {
44 // createLimiter builds a limiter with given options.
45 - createLimiter(int, ...Option) Limiter
46 + createLimiter(int64, ...Option) Limiter
47 // takeOnceAfter attempts to Take at a specific time.
48 takeOnceAfter(time.Duration, Limiter)
49 // startTaking tries to Take() on passed in limiters in a loop/goroutine.
50 @@ -32,7 +32,7 @@
51 t *testing.T
52
53 clock *clock.Mock
54 - constructor func(int, ...Option) Limiter
55 + constructor func(int64, ...Option) Limiter
56 count atomic.Int32
57 // maxDuration is the time we need to move into the future for a test.
58 // It's populated automatically based on assertCountAt/afterFunc.
59 @@ -44,23 +44,23 @@
60 func runTest(t *testing.T, fn func(testRunner)) {
61 impls := []struct {
62 name string
63 - constructor func(int, ...Option) Limiter
64 + constructor func(int64, ...Option) Limiter
65 }{
66 {
67 name: "mutex",
68 - constructor: func(rate int, opts ...Option) Limiter {
69 + constructor: func(rate int64, opts ...Option) Limiter {
70 return newMutexBased(rate, opts...)
71 },
72 },
73 {
74 name: "atomic",
75 - constructor: func(rate int, opts ...Option) Limiter {
76 + constructor: func(rate int64, opts ...Option) Limiter {
77 return newAtomicBased(rate, opts...)
78 },
79 },
80 {
81 name: "atomic_int64",
82 - constructor: func(rate int, opts ...Option) Limiter {
83 + constructor: func(rate int64, opts ...Option) Limiter {
84 return newAtomicInt64Based(rate, opts...)
85 },
86 },
87 @@ -88,7 +88,7 @@
88 }
89
90 // createLimiter builds a limiter with given options.
91 -func (r *runnerImpl) createLimiter(rate int, opts ...Option) Limiter {
92 +func (r *runnerImpl) createLimiter(rate int64, opts ...Option) Limiter {
93 opts = append(opts, WithClock(r.clock))
94 return r.constructor(rate, opts...)
95 }
96 --- a/ratelimit_bench_test.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`ratelimit_bench_test.go`:
97 +++ b/ratelimit_bench_test.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`ratelimit_bench_test.go`:
98 @@ -14,9 +14,9 @@
99 for _, procs := range []int{1, 4, 8, 16} {
100 runtime.GOMAXPROCS(procs)
101 for name, limiter := range map[string]Limiter{
102 - "atomic": newAtomicBased(b.N * 1000000000000),
103 - "atomic_int64": newAtomicInt64Based(b.N * 1000000000000),
104 - "mutex": newMutexBased(b.N * 1000000000000),
105 + "atomic": newAtomicBased(int64(b.N) * int64(1000000000000)),
106 + "atomic_int64": newAtomicInt64Based(int64(b.N) * int64(1000000000000)),
107 + "mutex": newMutexBased(int64(b.N) * int64(1000000000000)),
108 } {
109 for ng := 1; ng < 16; ng++ {
110 runner(b, name, procs, ng, limiter, count)
111 --- a/ratelimit.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`ratelimit.go`:
112 +++ b/ratelimit.goscip-debian debian golang-uber-ratelimit 0.3.1-3 golang-uber-ratelimit/upstream/`ratelimit.go`:
113 @@ -53,7 +53,7 @@
114 }
115
116 // New returns a Limiter that will limit to the given RPS.
117 -func New(rate int, opts ...Option) Limiter {
118 +func New(rate int64, opts ...Option) Limiter {
119 return newAtomicInt64Based(rate, opts...)
120 }
121