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

Set the result type before calling exec from Ping #509

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

nyergler
Copy link
Contributor

@nyergler nyergler commented Nov 30, 2021

Description

If the context has been set to Async Mode, the driver will attempt to
inspect the result type. If the result type has not been set, the driver
will panic when returning the [partial] result.

We ran into this issue when pinging a connection to test for aliveness when the context had WithAsyncMode applied. While async mode doesn't make a lot of sense for pings, in this case the same context is used to ping before executing a query.

Happy to write a test, just wasn't clear to me where Ping tests would live.

Checklist

  • Code compiles correctly
  • Run make fmt to fix inconsistent formats
  • Run make lint to get lint errors and fix all of them
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

@sfc-gh-jbahk
Copy link
Collaborator

Hi @nyergler , yes would you mind writing a test for this? Thank you.

@nyergler
Copy link
Contributor Author

nyergler commented Dec 7, 2021

@sfc-gh-jbahk Of course; any chance you can point me to the right place for that to live? Wasn't immediately clear to me how Ping is currently being tested.

@sfc-gh-jbahk
Copy link
Collaborator

I think connection_test.go should suffice. Its tests are in driver_test.go at the moment, but I think it makes sense to move it under the former.

@sfc-gh-pfus
Copy link
Collaborator

Hello @nyergler ! Are you planning to rebase and provide a test for your solution? I'd like to merge it when it is ready and tested :)

@nyergler
Copy link
Contributor Author

Thanks for the nudge, @sfc-gh-pfus ; I'll take a look at that this week.

@nyergler nyergler requested a review from a team as a code owner October 19, 2023 15:56
@github-actions
Copy link

github-actions bot commented Oct 19, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@nyergler
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@nyergler
Copy link
Contributor Author

@sfc-gh-pfus Updated.

@jc
Copy link

jc commented Oct 19, 2023

I have read the CLA Document and I hereby sign the CLA

@nyergler
Copy link
Contributor Author

recheck

@sfc-gh-pfus
Copy link
Collaborator

Hello @nyergler ! I approved your PR, but in the meantime a colleague of mine merged his PR. Since this is cross-repo PR I cannot rebase it myself. Can you rebase?

If the context has been set to Async Mode, the driver will attempt to
inspect the result type. If the result type has not been set, the driver
will panic when returning the [partial] result.
@nyergler
Copy link
Contributor Author

@sfc-gh-pfus Done.

@sfc-gh-pfus sfc-gh-pfus merged commit 8ed5c10 into snowflakedb:master Oct 23, 2023
26 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
@sfc-gh-pfus
Copy link
Collaborator

Thank you very much @nyergler ! I merged your PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants