testbot 0.7.11 → 0.7.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODljYWYyOTMwNjg1YmM0NWZlYTA0MTllZTE5NjAzYjAyYmQ0ZjAwNw==
4
+ NDliMDM2NjM2YTU3M2FmNjFhYjEwYWY0NWFlMTcwZmYzYjk2MjEyYw==
5
5
  data.tar.gz: !binary |-
6
- Zjc3YzcyMDg2MTY1OTk2Y2JiMjdjMTQxNmMxOGNiMzhiOWU5ZDlmYg==
6
+ MTNiNjJiOGI0MGNiMmM3YzcwYzcwYjdjZDZlMzdlM2IxNTY0Njg2MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGI5OWQxMjI2ODJjZGVlNjc4OGQ0MGM3MGZhZWM0OTIwMzU2M2MyYTI2YTBk
10
- ZjZhYmQwOTRkMjg2NTE0M2FkMGZlOTcwZTRmYWU2NGQ2YzBjMDU3Zjk1ZTcw
11
- ZmFhNDMwZjBiZTY1N2YxZjg3ZDFlN2E3OWZlM2M5YTNjYWEzNmU=
9
+ NDNlMzMwZGY5M2UwN2IyYjVjZDQ0Njc2NWNhNWY2MmI5MmRlMGE3NzFkZTlk
10
+ ZDFkNzQ1ZWNhYmY3NzJhYWYzN2NkYjQyOTI4NzVkM2M3OTc5ZDMyMzYyNjZj
11
+ MzgzODIyYjI4YzIyMWU3MDJiMzFiOTJlMzkwZTRkMmQ3NjEyZjA=
12
12
  data.tar.gz: !binary |-
13
- ZjNlNmZiOWIzMDQ0OTdiY2EzZDA2NGFlOGRmYTA4MjYzNTZiMGY3NzQ0YTQ0
14
- YjNiNzA4ODY1MzkzMDJmZjIwZDY1YTg3NTQ1YjAyZTQ4YjliMDJiZWU0MDRi
15
- OTMxMGEwMDYxOGIyMTRiZjhhNTNhYWJiYTNlYzcxNWQ3MGEwYzk=
13
+ ZTAxOGJiZjg1MTZhMTE2OTU3YjMxMTI0MWMzOWYwYzNiOGIwODU4NTJmNDY2
14
+ MDQ2OWZjMWEyOGYxNWU4YTg3MDE0ZTAyYzc2YmQzNGE4YzJjZTZjYWIzM2M4
15
+ ZmYzZDY4OTEzMjhiMjBlYmE3NTdlZmJlMWVjNDljOTBiMDU2YzM=
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.7.12
2
+
3
+ Adjust SSH timeout to decrease risk of undesired parallel connections.
4
+
1
5
  0.7.11
2
6
 
3
7
  Longer SSH timeout to work better on poorer connections.
@@ -67,7 +67,7 @@ Using testbot with Rails 2:
67
67
 
68
68
  # Add testbot to your Gemfile if you use bundler. You also need the plugin because
69
69
  # Rails 2 does not load raketasks from gems.
70
- ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.7.11'
70
+ ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.7.12'
71
71
  script/generate testbot --connect 192.168.0.100
72
72
 
73
73
  rake testbot:spec (or :rspec, :test, :features)
@@ -2,8 +2,10 @@ require 'rubygems'
2
2
  require 'net/ssh'
3
3
 
4
4
  class SSHTunnel
5
- # 10 seconds was too short for users with poorer connections.
6
- TIMEOUT_SECONDS = 15
5
+ # We want a small number so this fails quickly when unreachable. But not too small: a lower value caused false negatives on a poor connection.
6
+ # We want the inner timeout (the SSH connection) to trigger before the outer (loop), to avoid the situation where we make two connections in parallel.
7
+ INNER_TIMEOUT_SECONDS = 15
8
+ OUTER_TIMEOUT_SECONDS = INNER_TIMEOUT_SECONDS + 1
7
9
 
8
10
  def initialize(host, user, local_port = 2288)
9
11
  @host, @user, @local_port = host, user, local_port
@@ -17,7 +19,7 @@ class SSHTunnel
17
19
  break if @up
18
20
  sleep 0.5
19
21
 
20
- if Time.now - start_time > TIMEOUT_SECONDS
22
+ if Time.now - start_time > OUTER_TIMEOUT_SECONDS
21
23
  puts "SSH connection failed, trying again... (#{@user}@#{@host})"
22
24
  start_time = Time.now
23
25
  connect
@@ -28,7 +30,7 @@ class SSHTunnel
28
30
  def connect
29
31
  @thread.kill if @thread
30
32
  @thread = Thread.new do
31
- Net::SSH.start(@host, @user, { :timeout => TIMEOUT_SECONDS }) do |ssh|
33
+ Net::SSH.start(@host, @user, { :timeout => INNER_TIMEOUT_SECONDS }) do |ssh|
32
34
  ssh.forward.local(@local_port, 'localhost', Testbot::SERVER_PORT)
33
35
  ssh.loop { @up = true }
34
36
  end
@@ -1,7 +1,7 @@
1
1
  module Testbot
2
2
  # Don't forget to update readme and changelog
3
3
  def self.version
4
- version = "0.7.11"
4
+ version = "0.7.12"
5
5
  dev_version_file = File.join(File.dirname(__FILE__), '..', '..', 'DEV_VERSION')
6
6
  if File.exists?(dev_version_file)
7
7
  version += File.read(dev_version_file)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.11
4
+ version: 0.7.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joakim Kolsjö
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-27 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra