Skip to content

Make test_telnet.py fast#254

Merged
mgedmin merged 1 commit intomasterfrom
make-telnet-test-fast
Apr 27, 2019
Merged

Make test_telnet.py fast#254
mgedmin merged 1 commit intomasterfrom
make-telnet-test-fast

Conversation

@mgedmin
Copy link
Copy Markdown
Contributor

@mgedmin mgedmin commented Apr 25, 2019

Linkchecker's telnet://username:password@host:port URL verification logic is

  • connect to host:port
  • wait for 'login: ' to appear (with a 10 second timeout), send username
  • wait for 'Password: ' to appear (with a 10 second timeout), send password

The test spawns a fake telnet server on localhost that never presented
the login/password prompts, forcing the 10 second timeout three times.

This commit makes the fake telnet server emit the expected prompts,
making the test pass in .2 seconds.

@mgedmin mgedmin requested a review from anarcat April 27, 2019 07:26
Copy link
Copy Markdown
Contributor

@anarcat anarcat left a comment

Choose a reason for hiding this comment

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

LGTM. I have frankly zero idea why the hell we're doing telnet in linkchecker in the first place, but might as well fix this.

Linkchecker's telnet://username:password@host:port URL verification logic is

- connect to host:port
- wait for 'login: ' to appear (with a 10 second timeout), send username
- wait for 'Password: ' to appear (with a 10 second timeout), send password

The test spawns a fake telnet server on localhost that never presented
the login/password prompts, forcing the 10 second timeout three times.

This commit makes the fake telnet server emit the expected prompts,
making the test pass in .2 seconds.
@mgedmin mgedmin force-pushed the make-telnet-test-fast branch from 505940a to 947b108 Compare April 27, 2019 18:52
@mgedmin mgedmin merged commit ecba4e7 into master Apr 27, 2019
@mgedmin mgedmin deleted the make-telnet-test-fast branch April 27, 2019 18:58
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