Commit d377679
authored
TCP: Make HandleConnCloseTest[46] work reliably on Darwin and related fixes (project-chip#42136)
* TestTCP: Retry with different ports on EADDRINUSE
* TestTCP: Make HandleConnCloseTest[46] work reliably on Darwin
Wait until after HandleConnectionReceived() is called before closing the client
connection, otherwise we can't be sure the connection actually gets accepted at
the application level (as opposed to in the kernel) on the server side.
Also add some logging to the callbacks, and check that the callbacks are
actually being called with the expected handles. Remove some unused test code.
* TCPConnect base implementation should not return CHIP_NO_ERROR
* Darwin: Detect saLen == 0 from accept() and ignore the connection
* TCPTest: Add test for "late" failure (in TCP.DoHandleIncomingConnection)
* TCP: Remove the fallback for GetPeerAddress
The updated tests show this is no longer needed. I encountered no test failures
in 1000 repetitions on either Linux or Darwin. Certain test scenarios have a
chance of logging a "Failure accepting incoming connection" error, but these
are cases where the client-side socket is being closed as soon as it's
connected. Particularly on Darwin this may then cause the GetPeerAddress call
to fail (Linux doesn't seem to exhibit this behavior.)
* From review: make test macro docs less verbose1 parent 013e1bb commit d377679
File tree
6 files changed
+195
-141
lines changed- src
- inet
- lib/support/tests
- transport/raw
- tests
6 files changed
+195
-141
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1013 | 1019 | | |
1014 | 1020 | | |
1015 | 1021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 73 | + | |
85 | 74 | | |
86 | 75 | | |
87 | 76 | | |
88 | 77 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 78 | + | |
101 | 79 | | |
102 | | - | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
| 635 | + | |
| 636 | + | |
641 | 637 | | |
642 | | - | |
643 | | - | |
| 638 | + | |
644 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
645 | 646 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
| 647 | + | |
650 | 648 | | |
651 | 649 | | |
652 | 650 | | |
| |||
741 | 739 | | |
742 | 740 | | |
743 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
744 | 746 | | |
745 | 747 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
0 commit comments