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

Provide test coverage at integration level for network errors #244

Closed
astratto opened this issue Dec 21, 2015 · 1 comment
Closed

Provide test coverage at integration level for network errors #244

astratto opened this issue Dec 21, 2015 · 1 comment

Comments

@astratto
Copy link
Contributor

We should have integration tests to cover connection failures/timeouts.

One possible approach is to use iptables to drop/reject packets.

For instance, to test that a socket connect timeout is triggered, something like
iptables -A OUTPUT -p tcp -j DROP --dport 389 can be used.

We should investigate how to play with this on Travis.

astratto added a commit to astratto/ruby-net-ldap that referenced this issue Dec 21, 2015
This patch prevents LDAP connections to hang up for an eccessive amount of time
and instead returns earlier in case of failures (e.g., packets dropped).

A new option is now exposed through Net::LDAP:
- connect_timeout: sets a timeout for socket#connect (defaults to 1s)

It also provides an integration test to validate the new behaviour (ruby-ldap#244)
@jch
Copy link
Member

jch commented Dec 28, 2015

We should investigate how to play with this on Travis.

👍

astratto added a commit to astratto/ruby-net-ldap that referenced this issue Jan 5, 2016
This patch prevents LDAP connections to hang up for an eccessive amount of time
and instead returns earlier in case of failures (e.g., packets dropped).

A new option is now exposed through Net::LDAP:
- connect_timeout: sets a timeout for socket#connect (defaults to 1s)

It also provides an integration test to validate the new behaviour (ruby-ldap#244)
@jch jch closed this as completed Jan 5, 2016
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

No branches or pull requests

2 participants