Skip to content

Conversation

addaleax
Copy link
Collaborator

This also means that e.g. host:port?option=value is not allowed,
and instead any optional part after the port in the non-URL variant
needs to be separated by a slash (which was also the case in
the legacy shell).

…SH-792

This also means that e.g. `host:port?option=value` is not allowed,
and instead any optional part after the port in the non-URL variant
needs to be separated by a slash (which was also the case in
the legacy shell).
it('when specifying multiple seeds through --host with a wrong replsetid', async() => {
const hostlist = 'wrongreplset/' + await rs2.hostport() + ',' + await rs1.hostport() + ',' + await rs0.hostport();
const shell = TestShell.start({ args: ['--host', hostlist, 'admin?serverSelectionTimeoutMS=2000'] });
const shell = TestShell.start({ args: ['--host', hostlist, 'admin'] });
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legacy shell would have interpreted the previous string as an entire database name here (and it would be a valid one)

if (connectionString.hosts.length === 1 &&
['localhost', '127.0.0.1'].includes(connectionString.hosts[0].split(':')[0])) {
if (connectionString.hosts.every(host =>
['localhost', '127.0.0.1'].includes(host.split(':')[0]))) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a drive-by change to account for the fact that the e2e-direct test cannot use serverSelectionTimeoutMS directly anymore, but I feel like it still just makes sense

@addaleax addaleax merged commit c305532 into main May 26, 2021
@addaleax addaleax deleted the 792-dev branch May 26, 2021 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants