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

Fix Intermittently Failing Unit Test #259

Closed
aphralG opened this issue Mar 16, 2023 · 5 comments
Closed

Fix Intermittently Failing Unit Test #259

aphralG opened this issue Mar 16, 2023 · 5 comments
Labels
bug Something isn't working good-first-issue Good for newcomers

Comments

@aphralG
Copy link
Contributor

aphralG commented Mar 16, 2023

The unit test on the pipeline fails intermittently with the error below. It seems to be the commander_test.go that is failing.

Example of pipeline failing: https://github.com/nginx/agent/actions/runs/4436873229/jobs/7785851614

Error:

time="2023-03-16T12:12:39Z" level=info msg="Commander received meta:<message_id:\"1234\" > , <nil>"
Recv Command: <nil>
Recv Command Error: rpc error: code = Canceled desc = context canceled
time="2023-03-16T12:12:39Z" level=info msg="Commander received <nil>, rpc error: code = Canceled desc = grpc: the client connection is closing"
time="2023-03-16T12:12:39Z" level=error msg="Commander Channel Recv: error communicating with bufnet, code=Canceled, message=grpc: the client connection is closing"
time="2023-03-16T12:12:39Z" level=info msg="Commander Channel Recv: retrying to connect to bufnet"
time="2023-03-16T12:12:39Z" level=warning msg="Error closing old grpc connection: rpc error: code = Canceled desc = grpc: the client connection is closing"
time="2023-03-16T12:12:39Z" level=error msg="Unable to create command channel: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing closed\""
time="2023-03-16T12:12:39Z" level=info msg="Commander retrying to connect to bufnet"
Recv Command: meta:<message_id:"1234" > 
Recv Command: <nil>
Recv Command Error: rpc error: code = Canceled desc = context canceled```
@aphralG aphralG added the good-first-issue Good for newcomers label Mar 16, 2023
@redaHamioui
Copy link

how can i reproduce the bug ?

@oliveromahony
Copy link
Contributor

oliveromahony commented Apr 3, 2023

Thanks for the interest, I think running the tests in the pipeline saw inconsistent behavior and the intermittent failures. Running the test locally might reproduce the issue. I added this fix #271 to tackle the problem. I'll update this if anything else needs to be done, otherwise I'll close it in a week or so

@Dean-Coakley
Copy link
Contributor

Dean-Coakley commented Apr 6, 2023

@oliveromahony
Copy link
Contributor

@redaHamioui we still have this issue if you want to take a look? Some changes were made in #268 to address it but I can get it to fail locally running the following command go test -timeout 30s github.com/nginx/agent/sdk/v2/client -v -count=10

It looks like a race condition with the channels is causing the problem

@oliveromahony
Copy link
Contributor

this appears to be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants