Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deflake transport timeout case #14861

Merged
merged 2 commits into from
Nov 27, 2022

Commits on Nov 27, 2022

  1. client/pkg/transport: deflake TestWriteReadTimeoutListener

    There is data race on `stop` channel. After verify write-timeout successfully,
    the case won't wait for `blocker` to receive close signal from `stop` channel.
    If the new `blocker`, which is to read-timeout verifier, get dial's result
    immediately, the new `blocker` might fetch the message from `stop` channel
    before old one and then close the connection, which causes that the
    `conn.Read` returns `EOF` when it reads data.
    
    How to reproduce this in linux devbox?
    
    Use `taskset` to limit the test process in one-cpu.
    
    ```bash
    cd ./client/pkg/transport
    go test -c -o /tmp/test --race=true ./
    taskset -c 0 /tmp/test -test.run TestWriteReadTimeoutListener -test.v -test.cpu 4 -test.count=10000 -test.failfast
    ```
    
    To fix this, suggest to use seperate `stop` channel to prevent from data
    race.
    
    Signed-off-by: Wei Fu <fuweid89@gmail.com>
    fuweid committed Nov 27, 2022
    Configuration menu
    Copy the full SHA
    8a88660 View commit details
    Browse the repository at this point in the history
  2. client/pkg/transport: fix typo in _test.go

    Signed-off-by: Wei Fu <fuweid89@gmail.com>
    fuweid committed Nov 27, 2022
    Configuration menu
    Copy the full SHA
    cd9ade5 View commit details
    Browse the repository at this point in the history