mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-19 01:14:58 +03:00
Improve connection timeout
This commit is contained in:
@@ -35,13 +35,20 @@ func mkPort(t *testing.T) uint16 {
|
||||
}
|
||||
|
||||
func startInstance(t *testing.T, options option.Options) {
|
||||
instance, err := box.New(context.Background(), options)
|
||||
var err error
|
||||
for retry := 0; retry < 3; retry++ {
|
||||
instance, err := box.New(context.Background(), options)
|
||||
require.NoError(t, err)
|
||||
err = instance.Start()
|
||||
if err != nil {
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
t.Cleanup(func() {
|
||||
instance.Close()
|
||||
})
|
||||
}
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, instance.Start())
|
||||
t.Cleanup(func() {
|
||||
instance.Close()
|
||||
})
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
||||
func testSuit(t *testing.T, clientPort uint16, testPort uint16) {
|
||||
|
||||
Reference in New Issue
Block a user