diff --git a/listener/inbound/anytls_test.go b/listener/inbound/anytls_test.go index 3c4b8ba0..5f295f79 100644 --- a/listener/inbound/anytls_test.go +++ b/listener/inbound/anytls_test.go @@ -11,6 +11,7 @@ import ( ) func testInboundAnyTLS(t *testing.T, inboundOptions inbound.AnyTLSOption, outboundOptions outbound.AnyTLSOption) { + t.Parallel() inboundOptions.BaseOption = inbound.BaseOption{ NameStr: "anytls_inbound", Listen: "127.0.0.1", diff --git a/listener/inbound/hysteria2_test.go b/listener/inbound/hysteria2_test.go index 086b5920..13e4115c 100644 --- a/listener/inbound/hysteria2_test.go +++ b/listener/inbound/hysteria2_test.go @@ -11,6 +11,7 @@ import ( ) func testInboundHysteria2(t *testing.T, inboundOptions inbound.Hysteria2Option, outboundOptions outbound.Hysteria2Option) { + t.Parallel() inboundOptions.BaseOption = inbound.BaseOption{ NameStr: "hysteria2_inbound", Listen: "127.0.0.1", diff --git a/listener/inbound/mux_test.go b/listener/inbound/mux_test.go index 32ba12c7..68c4a5ab 100644 --- a/listener/inbound/mux_test.go +++ b/listener/inbound/mux_test.go @@ -24,6 +24,7 @@ func (n *notCloseProxyAdapter) Close() error { func testSingMux(t *testing.T, tunnel *TestTunnel, out outbound.ProxyAdapter) { t.Run("singmux", func(t *testing.T) { for _, protocol := range singMuxProtocolList { + protocol := protocol t.Run(protocol, func(t *testing.T) { t.Parallel() singMuxOption := outbound.SingMuxOption{ diff --git a/listener/inbound/shadowsocks_test.go b/listener/inbound/shadowsocks_test.go index a957886b..770afbdd 100644 --- a/listener/inbound/shadowsocks_test.go +++ b/listener/inbound/shadowsocks_test.go @@ -32,9 +32,10 @@ func init() { } func testInboundShadowSocks(t *testing.T, inboundOptions inbound.ShadowSocksOption, outboundOptions outbound.ShadowSocksOption) { + t.Parallel() for _, cipher := range shadowsocksCipherList { + cipher := cipher t.Run(cipher, func(t *testing.T) { - t.Parallel() inboundOptions, outboundOptions := inboundOptions, outboundOptions // don't modify outside options value inboundOptions.Cipher = cipher outboundOptions.Cipher = cipher @@ -44,6 +45,7 @@ func testInboundShadowSocks(t *testing.T, inboundOptions inbound.ShadowSocksOpti } func testInboundShadowSocks0(t *testing.T, inboundOptions inbound.ShadowSocksOption, outboundOptions outbound.ShadowSocksOption) { + t.Parallel() password := shadowsocksPassword32 if strings.Contains(inboundOptions.Cipher, "-128-") { password = shadowsocksPassword16 diff --git a/listener/inbound/trojan_test.go b/listener/inbound/trojan_test.go index cfc4476d..c6ecbea8 100644 --- a/listener/inbound/trojan_test.go +++ b/listener/inbound/trojan_test.go @@ -11,6 +11,7 @@ import ( ) func testInboundTrojan(t *testing.T, inboundOptions inbound.TrojanOption, outboundOptions outbound.TrojanOption) { + t.Parallel() inboundOptions.BaseOption = inbound.BaseOption{ NameStr: "trojan_inbound", Listen: "127.0.0.1", diff --git a/listener/inbound/tuic_test.go b/listener/inbound/tuic_test.go index 236d3f81..4b9753c8 100644 --- a/listener/inbound/tuic_test.go +++ b/listener/inbound/tuic_test.go @@ -13,31 +13,35 @@ import ( var tuicCCs = []string{"cubic", "new_reno", "bbr"} func testInboundTuic(t *testing.T, inboundOptions inbound.TuicOption, outboundOptions outbound.TuicOption) { + t.Parallel() inboundOptions.Users = map[string]string{userUUID: userUUID} inboundOptions.Token = []string{userUUID} for _, tuicCC := range tuicCCs { - t.Run("v4", func(t *testing.T) { + tuicCC := tuicCC + t.Run(tuicCC, func(t *testing.T) { t.Parallel() - inboundOptions, outboundOptions := inboundOptions, outboundOptions // don't modify outside options value - outboundOptions.Token = userUUID - outboundOptions.CongestionController = tuicCC - inboundOptions.CongestionController = tuicCC - testInboundTuic0(t, inboundOptions, outboundOptions) - }) - t.Run("v5", func(t *testing.T) { - t.Parallel() - inboundOptions, outboundOptions := inboundOptions, outboundOptions // don't modify outside options value - outboundOptions.UUID = userUUID - outboundOptions.Password = userUUID - outboundOptions.CongestionController = tuicCC - inboundOptions.CongestionController = tuicCC - testInboundTuic0(t, inboundOptions, outboundOptions) + t.Run("v4", func(t *testing.T) { + inboundOptions, outboundOptions := inboundOptions, outboundOptions // don't modify outside options value + outboundOptions.Token = userUUID + outboundOptions.CongestionController = tuicCC + inboundOptions.CongestionController = tuicCC + testInboundTuic0(t, inboundOptions, outboundOptions) + }) + t.Run("v5", func(t *testing.T) { + inboundOptions, outboundOptions := inboundOptions, outboundOptions // don't modify outside options value + outboundOptions.UUID = userUUID + outboundOptions.Password = userUUID + outboundOptions.CongestionController = tuicCC + inboundOptions.CongestionController = tuicCC + testInboundTuic0(t, inboundOptions, outboundOptions) + }) }) } } func testInboundTuic0(t *testing.T, inboundOptions inbound.TuicOption, outboundOptions outbound.TuicOption) { + t.Parallel() inboundOptions.BaseOption = inbound.BaseOption{ NameStr: "tuic_inbound", Listen: "127.0.0.1", @@ -69,8 +73,9 @@ func testInboundTuic0(t *testing.T, inboundOptions inbound.TuicOption, outboundO func TestInboundTuic_TLS(t *testing.T) { inboundOptions := inbound.TuicOption{ - Certificate: tlsCertificate, - PrivateKey: tlsPrivateKey, + Certificate: tlsCertificate, + PrivateKey: tlsPrivateKey, + AuthenticationTimeout: 5000, } outboundOptions := outbound.TuicOption{ Fingerprint: tlsFingerprint, diff --git a/listener/inbound/vless_test.go b/listener/inbound/vless_test.go index a307753b..04f441f1 100644 --- a/listener/inbound/vless_test.go +++ b/listener/inbound/vless_test.go @@ -11,6 +11,7 @@ import ( ) func testInboundVless(t *testing.T, inboundOptions inbound.VlessOption, outboundOptions outbound.VlessOption) { + t.Parallel() inboundOptions.BaseOption = inbound.BaseOption{ NameStr: "vless_inbound", Listen: "127.0.0.1", diff --git a/listener/inbound/vmess_test.go b/listener/inbound/vmess_test.go index 3456d1fd..a9b99de7 100644 --- a/listener/inbound/vmess_test.go +++ b/listener/inbound/vmess_test.go @@ -11,6 +11,7 @@ import ( ) func testInboundVMess(t *testing.T, inboundOptions inbound.VmessOption, outboundOptions outbound.VmessOption) { + t.Parallel() inboundOptions.BaseOption = inbound.BaseOption{ NameStr: "vmess_inbound", Listen: "127.0.0.1",