-
Notifications
You must be signed in to change notification settings - Fork 4k
roachtest: fix allow_unsafe_internals edge cases #156795
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
Conversation
pkg/cmd/roachtest/tests/network.go
Outdated
|
|
||
| // Construct a connection URL to server i. | ||
| url := serverUrls[server-1] | ||
| url := fmt.Sprintf("{pgurl:%d}", server-1) |
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.
Should this not be just fmt.Sprintf("{pgurl:%d}", server), and not server-1, since I think expanders start from 1?
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.
Ah good catch, I was confused why the test didn't fail in this case, but it looks like it was "saved" by:
if i == expectedLeaseholder {
continue
}
where expectedLeaseholder = 1
This test uses a pgurl as part of a shell command, so it needs to be escaped to avoid any stray ampersands.
We sometimes need to construct pgurls for psql or postgres dbs which don't support this CRDB only parameter.
4fdcd7a to
8913ec0
Compare
| } | ||
|
|
||
| // Silence unused warning. | ||
| var _ = (&clusterImpl{}).InternalPGUrl |
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.
Good riddance.
|
|
||
| // Construct a connection URL to server i. | ||
| url := serverUrls[server-1] | ||
| url := fmt.Sprintf("{pgurl:%d}", server) |
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.
Nice.
|
TFTRs bors r=herkolategan, srosenberg |
In #156581, we started setting
allow_unsafe_internalsunconditionally for roachtests. However, there are a few edge cases where we can't set this. Namely when usingpsqlto connect to a postgres database where the CRDB only parameter does not exist.Fixes: #156702
Fixes: #156703
Fixes: #156706
Release note: none