-
Notifications
You must be signed in to change notification settings - Fork 1.5k
cmd/exec: Update tests to run sync when ready #7835
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
cmd/exec: Update tests to run sync when ready #7835
Conversation
| return err == nil && resp.StatusCode == 200 | ||
| }) | ||
|
|
||
| _ = runExec(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt it was ok to just check the logged errors since we're in the cmd package. For me, it made the tests easier to follow.
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
6c01bf8 to
43395fb
Compare
philipaconrad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good cleanup to me! Sorry I didn't notice the review request sooner-- it got buried in the general notification spam. 🙃
|
Thanks for the review, I was mega slow to get back to this after a trip last week so I'll sort it out later. |
14bb17a to
27bad57
Compare
johanfylling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
cmd/exec_test.go
Outdated
|
|
||
| // when bundles fail to parse, OPA never signals the ready channel, causing | ||
| // runExec to hang indefinitely. WithContext allows us to cancel the context | ||
| // when when we have the required errors logged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] when hiccup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, fixed that too!
Following: open-policy-agent#7821 I think we can avoid using the async running of exec when we know the bundle server is ready to go. I saw some more issues from these tests in https://github.com/open-policy-agent/opa/actions/runs/16905415883/job/47894071103?pr=7825 and am trying to make them more reliable this way. Signed-off-by: Charlie Egan <[email protected]>
27bad57 to
9b630a4
Compare
Following: #7821 I think we can avoid using the async running of exec when we know the bundle server is ready to go.
I saw some more issues from these tests in
https://github.com/open-policy-agent/opa/actions/runs/16905415883/job/47894071103?pr=7825 and am trying to make them more reliable this way.
I left the async that's needed in TestExecWithBundleRegoVersion where runExec does not complete, here we just wait for the messages and then stop, but now we shutdown the goroutine nicely.