diff --git a/docs/Tests.Detection-of-unstable-tests.md b/docs/Tests.Detection-of-unstable-tests.md index 31f58afaa0..ceb63313d1 100644 --- a/docs/Tests.Detection-of-unstable-tests.md +++ b/docs/Tests.Detection-of-unstable-tests.md @@ -137,3 +137,5 @@ $ grep coverage ./logs/internal/*.log ``` Note 0.0% coverage + +Test removed. diff --git a/internal/noise/read_writer_test.go b/internal/noise/read_writer_test.go index 12a2696fb8..31ab88e116 100644 --- a/internal/noise/read_writer_test.go +++ b/internal/noise/read_writer_test.go @@ -1,10 +1,7 @@ package noise import ( - "errors" - "fmt" "net" - "sync" "testing" "time" @@ -126,71 +123,3 @@ func TestReadWriterXKPattern(t *testing.T) { assert.Equal(t, 3, n) assert.Equal(t, []byte("bar"), buf) } - -func TestReadWriterConcurrentTCP(t *testing.T) { - const readCount = 15 - readErrs := make([]error, readCount) - writeErrs := make([]error, readCount) - msg := []byte("foo") - - errNoOp := errors.New("no operation") - for i := 0; i < readCount; i++ { - readErrs[i] = errNoOp - writeErrs[i] = errNoOp - } - - l, err := net.Listen("tcp", ":0") // nolint: gosec - require.NoError(t, err) - defer l.Close() - - var wg sync.WaitGroup - wg.Add(1) - go func() { - conn, err := l.Accept() - if err != nil { - return - } - - var rwg sync.WaitGroup - for i := 0; i < readCount; i++ { - rwg.Add(1) - go func(idx int, c net.Conn) { - buf := make([]byte, 3) - if _, err := c.Read(buf); err != nil { - readErrs[idx] = err - } - - if string(buf) != "foo" { - readErrs[idx] = errors.New("invalid message") - } - - readErrs[idx] = nil - rwg.Done() - }(i, conn) - } - rwg.Wait() - wg.Done() - }() - - conn, err := net.Dial("tcp", l.Addr().String()) - require.NoError(t, err) - defer conn.Close() - - for i := 0; i < readCount; i++ { - wg.Add(1) - go func(idx int, c net.Conn) { - if _, err := c.Write(msg); err != nil { - writeErrs[idx] = err - } - - writeErrs[idx] = nil - wg.Done() - }(i, conn) - } - wg.Wait() - - for i := 0; i < readCount; i++ { - require.NoError(t, readErrs[i], fmt.Sprintf("read #%d", i)) - require.NoError(t, writeErrs[i], fmt.Sprintf("write #%d", i)) - } -}