mirror of https://github.com/grpc/grpc.git
[Fix Flake] Fix contextvar test issue (#38076)
`//src/python/grpcio_tests/tests/unit:_contextvars_propagation_test` is very flaky, mainly in two ways: 1. Failing with error `Error in bind for address '/tmp/grpc_fullstack_test.sock': Address already in use`. 2. Failing with timeout without any error. #### Address already in use error This is because we're reusing the same path for all test cases:pull/37782/merge5011420f16/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py (L31)
#### Timeout error We're deleting tmp file after test is done:5011420f16/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py (L64-L66)
This might cause Core fail to connect to channel with error: `connect failed: addr: unix:/tmp/grpc_fullstack_test.sock error: No such file or directory`, Core will keep retrying and thus causing the test to timeout. To make things worse, we're using multiple threads in one of the test case, leading to an even higher rate of flakiness. This PR fix the issue by using different address for different test runs. <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. --> Closes #38076 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38076 from XuanWang-Amos:fix_contextvar_test93ab2b350f
PiperOrigin-RevId: 693812629
parent
c4682fe259
commit
d53dde77dc
1 changed files with 2 additions and 2 deletions
Loading…
Reference in new issue