Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew committed Sep 13, 2015
1 parent c232699 commit 4970d3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/mysql2/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,13 @@ def run_gc
end

it 'should be impervious to connection-corrupting timeouts in #execute' do
pending('`Thread.handle_interrupt` is not defined') unless Thread.respond_to?(:handle_interrupt)
# The connection handle gets corrupted and will segfault the tests if left unprotected
skip('`Thread.handle_interrupt` is not defined') unless Thread.respond_to?(:handle_interrupt)

# attempt to break the connection
stmt = @client.prepare('SELECT SLEEP(?)')
expect { Timeout.timeout(0.1) { stmt.execute(0.2) } }.to raise_error(Timeout::Error)
stmt.close

# expect the connection to not be broken
expect { @client.query('SELECT 1') }.to_not raise_error
Expand Down

0 comments on commit 4970d3f

Please sign in to comment.