Commit 3d69d9a
committed
pairing: Add retry logic to get_pairing_data to fix flaky test
The test_pairing_session test was flaky due to a race condition in the
pairing protocol. The NewDeviceClient generates the device_id locally
and sends it via the QR code channel before the PairDevice gRPC request
reaches the server. When the AttestationDeviceClient immediately calls
GetPairingData with that device_id, the session might not exist yet.
This adds retry logic to get_pairing_data that retries for up to 10
seconds with 100ms intervals, handling the inherent race condition
in the pairing protocol.1 parent 97ae772 commit 3d69d9a
1 file changed
Lines changed: 26 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
| |||
0 commit comments