Repository navigation
Commit 16d8cba
authored
test(hidpp): wait for the message listener before asserting on it (#2503)
test(hidpp): wait for the message listener before asserting on it
raw_listener_gets_every_report_intact_including_foreign_vendor_pdus
waited only for the raw listener count, then asserted that exactly one
message had reached the message listener. read_loop hands each report to
the raw listeners before it parses it as HID++ and dispatches it to the
message listeners, so the raw count can reach 2 while the short message
is still on its way to the message path. That window failed the test
once on tests (macos, x86_64).
Wait for the message listener too, and record what it receives: the
assertion now compares the delivered messages with [short]. A call
count alone would let a vendor PDU that wrongly reached the message
path satisfy the wait in place of the short message.
The timeout panic in wait_for_atomic_count now also reports the count
it saw.1 parent 5a4c174 commit 16d8cba
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| |||
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
| 170 | + | |
166 | 171 | | |
167 | | - | |
| 172 | + | |
| 173 | + | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| |||
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
182 | | - | |
183 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
184 | 194 | | |
185 | 195 | | |
186 | 196 | | |
| |||
0 commit comments