Commit e1d242f
Fix 3 flaky thrift tests: InteractionTest, ServiceHealthPoller, RocketNetwork
Summary:
Fix race conditions and timing-sensitivity in three flaky thrift tests.
1. InteractionTest::PrioritizedInteractionRequest (cpp2/test/InteractionTest.cpp):
The test had a race between TilePromise::fulfill() executing asynchronously
on the EventBase thread and the concurrency controller dequeuing the next
request. If the interaction request was dequeued before the tile was fully
registered, it would hit an uninitialized TilePromise. Fixed by completing
the factory method synchronously (get() on sf1) before proceeding, and
using a separate "blocker" addPrimitive(0,0) call to occupy the worker
thread instead of relying on the interaction setup.
2. ServiceHealthPollerTest::DynamicLiveness (cpp2/test/ServiceHealthPollerTest.cpp):
The test used co_await sleep(50ms) then checked the result, which was
timing-dependent and could fail under CI load. Replaced with event-driven
co_await result->co_next() which waits for the actual state change. Also
increased liveness interval from 200ms to 500ms to ensure the "unchanged
because liveness is large" assertion has sufficient margin.
3. RocketNetworkTest::ObserverIsNotInstalledWhenFlagIsFalse
(transport/rocket/test/network/RocketNetworkTest.cpp):
After reconnect(), the old server-side connection may linger briefly while
the new one is already created. The retry loop in getServerConnection()
only tried 10 times which was insufficient under CI load. Increased to
50 retries.
Reviewed By: evanjzou
Differential Revision: D94987644
fbshipit-source-id: 16a0e176290f9ca42859e15ee21fa993ced89e0d1 parent 2dc30c9 commit e1d242f
3 files changed
Lines changed: 35 additions & 24 deletions
File tree
- third-party/thrift/src/thrift/lib/cpp2
- test
- transport/rocket/test/network
Lines changed: 28 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 111 | + | |
118 | 112 | | |
119 | 113 | | |
120 | 114 | | |
121 | | - | |
122 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
| 143 | + | |
140 | 144 | | |
141 | | - | |
142 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
143 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | | - | |
| 154 | + | |
147 | 155 | | |
148 | | - | |
| 156 | + | |
149 | 157 | | |
150 | 158 | | |
151 | 159 | | |
| |||
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
160 | 168 | | |
161 | | - | |
| 169 | + | |
| 170 | + | |
162 | 171 | | |
163 | 172 | | |
164 | | - | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
| 246 | + | |
| 247 | + | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | | - | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
0 commit comments