Commit cbc2c21
authored
Fix flaky TestDataSampler/GetSamplesForPCollectionsTooManySamples (#38736)
Since GetSamples is a destructive operation that clears stored samples,
polling it in a loop is flaky. If it is called before all asynchronous
samples have finished processing, it consumes the early samples and clears
them, causing verifySampledElements to fail.
In this PR, we wait for the sampler to finish before reading to ensure
all elements are successfully captured.1 parent f771827 commit cbc2c21
1 file changed
Lines changed: 3 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
117 | 110 | | |
118 | 111 | | |
119 | 112 | | |
| |||
0 commit comments