Commit 7e7462f
chore: Make pool tests pass
Fixes the failing pool tests in `plumbing` and `rlp/internal/ingress`
following the change to use `grpc.NewClient` instead of `grpc.Dial`.
This is because they were testing that connections were initiated when a
new doppler was added. However, with the change to NewClient,
connections won't be made until the resulting grpc client connections
are used for RPC. This also means that dopplers may be added to the pool
map when in the past they would not be added due to the connection on
Dial failing.
One approach to getting the existing tests to pass would have been to
call `Connect` on the grpc client connections to force them to leave
idle mode. However, `Connect` is experimental, and really gRPC is
encouraging us not to care about the connection state when creating
client connections.
To fix the tests we ended up just asserting on the pool size. One
downside of this was that we couldn't see a nice way to assert that
`Close` was called on the gRPC client connection when `Close` was called
for a doppler address. We could have replaced the connection creation
with an interface and mocked that but it didn't seem worth it.
Signed-off-by: Carson Long <[email protected]>
Signed-off-by: Rebecca Roberts <[email protected]>1 parent efe712a commit 7e7462f
File tree
4 files changed
+41
-99
lines changed- src
- plumbing
- rlp/internal/ingress
4 files changed
+41
-99
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 17 | | |
23 | 18 | | |
24 | 19 | | |
25 | 20 | | |
26 | 21 | | |
27 | 22 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 23 | + | |
46 | 24 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 25 | + | |
| 26 | + | |
50 | 27 | | |
51 | 28 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 29 | + | |
| 30 | + | |
60 | 31 | | |
| 32 | + | |
61 | 33 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
70 | 39 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
75 | 44 | | |
76 | 45 | | |
77 | 46 | | |
| |||
173 | 142 | | |
174 | 143 | | |
175 | 144 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 26 | + | |
33 | 27 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 28 | + | |
| 29 | + | |
37 | 30 | | |
38 | 31 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 32 | + | |
| 33 | + | |
44 | 34 | | |
| 35 | + | |
45 | 36 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
54 | 41 | | |
55 | 42 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
69 | 47 | | |
70 | 48 | | |
71 | 49 | | |
| |||
0 commit comments