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

Explicit offline mode #1503

Merged

Conversation

j-bennet
Copy link
Contributor

Closes #1468.

In case there's no internet connection, exit and suggest using --offline mode, as opposed to falling back to offline mode without asking.

Added an integration test as well.

it/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

This works great, thank you! I've asked a few minor changes.

esrally/utils/process.py Outdated Show resolved Hide resolved
it/__init__.py Outdated Show resolved Hide resolved
it/__init__.py Outdated Show resolved Hide resolved
it/basic_test.py Outdated Show resolved Hide resolved

@it.rally_in_mem
def test_run_without_http_connection(cfg):
cmd = it.esrally_command_line_for(cfg, "list races")
Copy link
Member

Choose a reason for hiding this comment

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

What the... I had no idea we sent a request to GitHub for every single invocation, even when just listing races. This makes esrally list races 1.4s slower for me!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be a nice thing to fix, probably in a separate PR, don't you think? I'm sure lots of commands don't need Rally to be online.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opened an issue so it's not forgotten: #1506.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for opening that issue!

j-bennet and others added 2 commits May 31, 2022 11:17
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
@j-bennet j-bennet requested a review from pquentin May 31, 2022 19:24
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for iterating.

@j-bennet j-bennet merged commit 3a1c993 into elastic:master Jun 1, 2022
@j-bennet j-bennet deleted the j-bennet/1468-explicit-offline-mode branch June 1, 2022 16:22
@pquentin pquentin added the enhancement Improves the status quo label Jun 23, 2022
@pquentin pquentin added this to the 2.5.0 milestone Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the status quo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail fast and suggest the user to run in --offline if no internet
2 participants