Commit 3cde59c
test: Wait for stream server checks to complete
The main test goroutine might be completed before checks on the server
goroutine are completed, hence cause the below panic issue. This commit
is to defer the streamDone channel close to make sure the error check on
the stream server is done before returning from the test. We keep the
time check on the wait in the end of each test to not stall the tests in
case the stream server fails to exit.
Panic error
```
panic: Fail in goroutine after Test/ServerSuite/TestRequestStaleNonce has completed
```
Testing was done as per below:
```
$ go test -count 500 -run Test/ServerSuite/TestRequestStaleNonce ./pkg/envoy/xds/...
ok github.com/cilium/cilium/pkg/envoy/xds 250.866s
```
Fixes: cilium#31855
Signed-off-by: Tam Mach <tam.mach@cilium.io>
Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>1 parent c869e6c commit 3cde59c
1 file changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | | - | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | | - | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
404 | 405 | | |
405 | | - | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
577 | 578 | | |
578 | | - | |
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
679 | 680 | | |
680 | | - | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
| 818 | + | |
818 | 819 | | |
819 | | - | |
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
| |||
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
| 952 | + | |
952 | 953 | | |
953 | | - | |
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
| 1085 | + | |
1085 | 1086 | | |
1086 | | - | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | 1089 | | |
| |||
0 commit comments