fix(test): fix all test bugs

This commit is contained in:
zarazaex69
2026-05-07 00:38:52 +03:00
parent ed682c3b82
commit 63dd61c61d
10 changed files with 111 additions and 46 deletions

View File

@@ -155,6 +155,7 @@ func (s *Server) setupResolver() {
func smuxConfig() *smux.Config {
cfg := smux.DefaultConfig()
cfg.Version = 2
cfg.KeepAliveDisabled = true
cfg.MaxFrameSize = 32768
cfg.MaxReceiveBuffer = 16 * 1024 * 1024
cfg.MaxStreamBuffer = 1024 * 1024
@@ -306,7 +307,7 @@ func (s *Server) serve(ctx context.Context) {
return
default:
}
logger.Infof("AcceptStream returned %v - reinstalling session", err)
logger.Debugf("AcceptStream returned %v - reinstalling session", err)
s.reinstallSession(sess)
continue
}

View File

@@ -40,7 +40,7 @@ func TestSetupCipherRejectsBadInput(t *testing.T) {
func TestSmuxConfig(t *testing.T) {
cfg := smuxConfig()
if cfg.Version != 2 || cfg.MaxFrameSize != 32768 || cfg.MaxReceiveBuffer != 16*1024*1024 {
if cfg.Version != 2 || !cfg.KeepAliveDisabled || cfg.MaxFrameSize != 32768 || cfg.MaxReceiveBuffer != 16*1024*1024 {
t.Fatalf("smuxConfig() = %+v", cfg)
}
}