Commit 1d39505
committed
NCBC-4163 Another stability pass on unit tests
Motivation
==========
Several unit tests intermittently fail on our CI.
We need to get these as deterministic as possible, given
the nature of the CI system
Modification
============
Add internal ForceFlush() to ThresholdTraceListener so Test_Logs
can trigger report generation directly. The test is now fully
synchronous since Start(), ActivityStopped, and ForceFlush are
all synchronous.
Rewrite LightweightStopwatchTests to verify the struct's contract
(non-negative, consistent, monotonic, restart resets) using
SpinWait instead of Task.Delay with fixed timing bounds.
Remove Task.Delay from InFlightOperationSetTests assertions.
The returned tasks are structurally incomplete (semaphore full /
Task.WhenAll on pending CompletionTasks), so IsCompleted can be
asserted immediately.
Results
=======
All 25 tests pass deterministically with zero timing
dependencies. No test skips required.
Change-Id: Ic6cde6e4ef93718342d57ce4c7322dd52796e0dc
Reviewed-on: https://review.couchbase.org/c/couchbase-net-client/+/241904
Reviewed-by: Emilien Bevierre <emilien.bevierre@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>1 parent 34ae40d commit 1d39505
4 files changed
Lines changed: 74 additions & 100 deletions
File tree
- src/Couchbase/Core/Diagnostics/Tracing/ThresholdTracing
- tests/Couchbase.UnitTests
- Core
- Diagnostics/Tracing
- IO/Connections
- Utils
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
| |||
Lines changed: 10 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
132 | | - | |
| 135 | + | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | | - | |
137 | | - | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 145 | + | |
154 | 146 | | |
| 147 | + | |
| 148 | + | |
155 | 149 | | |
156 | 150 | | |
157 | 151 | | |
| |||
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | | - | |
51 | | - | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
230 | | - | |
231 | | - | |
232 | | - | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
| |||
Lines changed: 53 additions & 78 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | | - | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
| 18 | + | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 22 | + | |
29 | 23 | | |
30 | 24 | | |
31 | | - | |
32 | | - | |
| 25 | + | |
| 26 | + | |
33 | 27 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 28 | + | |
38 | 29 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 30 | + | |
48 | 31 | | |
49 | 32 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 33 | | |
55 | | - | |
| 34 | + | |
56 | 35 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 36 | + | |
60 | 37 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 38 | + | |
| 39 | + | |
68 | 40 | | |
69 | 41 | | |
70 | | - | |
71 | | - | |
| 42 | + | |
| 43 | + | |
72 | 44 | | |
73 | | - | |
| 45 | + | |
| 46 | + | |
74 | 47 | | |
75 | | - | |
| 48 | + | |
| 49 | + | |
76 | 50 | | |
77 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
78 | 55 | | |
79 | | - | |
80 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
81 | 63 | | |
82 | | - | |
83 | | - | |
| 64 | + | |
| 65 | + | |
84 | 66 | | |
85 | 67 | | |
86 | 68 | | |
87 | 69 | | |
88 | 70 | | |
89 | 71 | | |
90 | 72 | | |
91 | | - | |
| 73 | + | |
92 | 74 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 75 | + | |
100 | 76 | | |
101 | | - | |
102 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
103 | 81 | | |
104 | | - | |
| 82 | + | |
| 83 | + | |
105 | 84 | | |
106 | | - | |
| 85 | + | |
| 86 | + | |
107 | 87 | | |
108 | 88 | | |
109 | 89 | | |
110 | | - | |
| 90 | + | |
111 | 91 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 92 | + | |
| 93 | + | |
120 | 94 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 95 | + | |
124 | 96 | | |
125 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
126 | 100 | | |
127 | | - | |
| 101 | + | |
| 102 | + | |
128 | 103 | | |
129 | 104 | | |
130 | 105 | | |
| |||
0 commit comments