Commit b015609
committed
fix(test): replace time.Sleep synchronization with deterministic polling
- ScheduleRetransmissions: register onTick handler synchronously instead
of in a goroutine; onTick is a fast mutex+map-insert and has no reason
to be async, and the goroutine created a registration race when tests
sent ticks before the handler was installed
- retransmission_test: drop pre-tick yield sleeps (no longer needed) and
replace 50ms post-tick sleeps with polling loops bounded by 2s deadline
- node_test: add waitForDispatcherIdle helper that polls until the wallet
dispatcher is idle; replace all time.Sleep(200ms/50ms) wait-for-goroutine
patterns with the helper
- signing_done: replace IIFE Lock/defer-Unlock pattern in write path with
explicit Lock/Unlock -- single-statement body has no early return, so
the closure adds indirection without benefit1 parent 6065ba6 commit b015609
4 files changed
Lines changed: 45 additions & 36 deletions
File tree
- pkg
- net/retransmission
- tbtc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 132 | | |
137 | 133 | | |
138 | 134 | | |
139 | 135 | | |
140 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 170 | | |
175 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
523 | | - | |
524 | | - | |
| 523 | + | |
525 | 524 | | |
526 | 525 | | |
527 | 526 | | |
| |||
587 | 586 | | |
588 | 587 | | |
589 | 588 | | |
590 | | - | |
591 | | - | |
| 589 | + | |
592 | 590 | | |
593 | 591 | | |
594 | 592 | | |
| |||
654 | 652 | | |
655 | 653 | | |
656 | 654 | | |
657 | | - | |
658 | | - | |
| 655 | + | |
659 | 656 | | |
660 | 657 | | |
661 | 658 | | |
| |||
716 | 713 | | |
717 | 714 | | |
718 | 715 | | |
719 | | - | |
720 | | - | |
| 716 | + | |
721 | 717 | | |
722 | 718 | | |
723 | 719 | | |
| |||
783 | 779 | | |
784 | 780 | | |
785 | 781 | | |
786 | | - | |
787 | | - | |
| 782 | + | |
788 | 783 | | |
789 | 784 | | |
790 | 785 | | |
| |||
831 | 826 | | |
832 | 827 | | |
833 | 828 | | |
834 | | - | |
835 | | - | |
| 829 | + | |
836 | 830 | | |
837 | 831 | | |
838 | 832 | | |
| |||
1242 | 1236 | | |
1243 | 1237 | | |
1244 | 1238 | | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1245 | 1252 | | |
1246 | 1253 | | |
1247 | 1254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
0 commit comments