stella 0.8.7.001 → 0.8.7.002

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -10,6 +10,13 @@ STELLA, CHANGES
10
10
  * TODO: request block conditions.
11
11
  * TODO: process templates for calls to set in get blocks
12
12
 
13
+ #### 0.8.7.002 (2010-06-14) ###############################
14
+
15
+ * FIXED: Specifying a host w/ a path and no testplan no longer doubles up the path
16
+ * ADDED: Global HTTP client timeout ("stella -T 60")
17
+ * CHANGE: Timeouts are reported as exceptions.
18
+
19
+
13
20
  #### 0.8.7 (2010-05-21) ###############################
14
21
 
15
22
  * FIXED: sequential, rsequential, and random values were broken for Arrays
data/VERSION.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :MAJOR: 0
3
3
  :MINOR: 8
4
4
  :PATCH: 7
5
- :BUILD: '001'
5
+ :BUILD: '002'
data/bin/stella CHANGED
@@ -45,6 +45,7 @@ class Stella::CLI::Definition
45
45
  global :W, :wait, Integer, "Seconds to wait before starting test"
46
46
  global :H, :withheader, "Include X-Stella-ID request header"
47
47
  global :P, :withparam, "Include __stella query parameter header"
48
+ global :T, :timeout, Float, "HTTP request timeout (default: unlimited)"
48
49
  global :o, :output, String, "Write output to the given file" do |v|
49
50
  String.disable_color
50
51
  Stella.log.output = v
data/lib/stella.rb CHANGED
@@ -17,7 +17,9 @@ require 'gibbler/aliases' # important for run time digests and freezes
17
17
  require 'benelux'
18
18
  require 'proc_source'
19
19
 
20
- class OpenStruct; include Gibbler::Object; end
20
+ class OpenStruct
21
+ include Gibbler::Object
22
+ end
21
23
 
22
24
  module Stella
23
25
  module VERSION
data/lib/stella/cli.rb CHANGED
@@ -25,7 +25,7 @@ class Stella::CLI < Drydock::Command
25
25
  [:nowait, :clients, :repetitions, :duration, :arrival, :granularity, :'wait'].each do |opt|
26
26
  opts[opt] = @option.send(opt) unless @option.send(opt).nil?
27
27
  end
28
- [:'notemplates', :'nostats', :'noheader', :'noparam'].each do |opt|
28
+ [:'notemplates', :'nostats', :'noheader', :'noparam', :'timeout'].each do |opt|
29
29
  opts[opt] = @global.send(opt) unless @global.send(opt).nil?
30
30
  end
31
31
  testrun = Stella::Testrun.new @testplan, opts
@@ -89,7 +89,7 @@ class Stella::CLI < Drydock::Command
89
89
  end
90
90
  @hosts = @argv.collect { |uri|;
91
91
  uri = 'http://' << uri unless uri.match /^https?:\/\//i
92
- URI.parse uri;
92
+ obj = URI.parse uri
93
93
  }
94
94
  if @option.testplan
95
95
  @testplan = Stella::Testplan.load_file @option.testplan
data/lib/stella/client.rb CHANGED
@@ -28,7 +28,8 @@ module Stella
28
28
  :withparam => false,
29
29
  :withheader => false,
30
30
  :notemplates => false,
31
- :wait => 0
31
+ :wait => 0,
32
+ :timeout => nil
32
33
  }.merge! opts
33
34
  @opts = opts
34
35
  @base_uri, @index = base_uri, index
@@ -86,8 +87,8 @@ module Stella
86
87
  http_client.set_auth(domain, user, pass)
87
88
  end
88
89
 
89
- if tout = req.timeout || usecase.timeout
90
- http_client.receive_timeout = tout
90
+ if tout = req.timeout || usecase.timeout || @opts[:timeout]
91
+ http_client.receive_timeout = tout if tout > 0
91
92
  end
92
93
  Stella.ld "TIMEOUT " << http_client.receive_timeout.to_s
93
94
 
@@ -145,7 +146,7 @@ module Stella
145
146
  asset_duration = Time.now - asset_start
146
147
  rescue HTTPClient::ConnectTimeoutError, HTTPClient::SendTimeoutError,
147
148
  Errno::ECONNRESET, HTTPClient::ReceiveTimeoutError => ex
148
- update(:request_timeout, usecase, uri, req, params, headers, counter, container)
149
+ update(:request_timeout, usecase, uri, req, params, headers, counter, container, http_client.receive_timeout)
149
150
  Benelux.remove_thread_tags :status, :retry, :request, :stella_id
150
151
  next
151
152
  rescue => ex
@@ -304,7 +305,7 @@ module Stella
304
305
 
305
306
  # Support for specifying default path prefix:
306
307
  # $ stella verify -p plan.rb http://localhost/basicauth
307
- if URI::Generic === base_uri && base_uri.path
308
+ if URI::Generic === base_uri && base_uri.path && uri != base_uri
308
309
  if uri.path.nil? || uri.path.empty?
309
310
  begin
310
311
  uri.path = base_uri.path
data/lib/stella/engine.rb CHANGED
@@ -95,6 +95,7 @@ class Stella::Testrun < Storable
95
95
  field :duration => Integer
96
96
  field :arrival => Float
97
97
  field :repetitions => Integer
98
+ field :timeout => Integer
98
99
  field :wait => Range
99
100
  field :nowait => TrueClass
100
101
  field :logsize => Integer
@@ -148,7 +149,8 @@ class Stella::Testrun < Storable
148
149
  :notemplates => self.notemplates || false,
149
150
  :withparam => self.withparam || false,
150
151
  :withheader => self.withheader || false,
151
- :wait => self.wait || 0
152
+ :wait => self.wait || 0,
153
+ :timeout => self.timeout
152
154
  }
153
155
  end
154
156
 
@@ -194,6 +196,7 @@ class Stella::Testrun < Storable
194
196
  # Support durations in the form "30m", "2h", etc...
195
197
  @duration = @duration.in_seconds if String === @duration
196
198
 
199
+ @timeout &&= @timeout.to_f
197
200
  @clients &&= @clients.to_i
198
201
  @duration &&= @duration.to_i
199
202
  @arrival &&= @arrival.to_f
@@ -6,6 +6,8 @@ module Stella::Engine
6
6
  client = Stella::Client.new testrun.hosts.first, testrun.client_options
7
7
  client.add_observer(self)
8
8
 
9
+ p testrun.client_options
10
+
9
11
  Stella.stdout.info2 $/, "Starting test...", $/
10
12
  testrun.start_time = Time.now.utc.to_i
11
13
 
@@ -145,9 +147,9 @@ module Stella::Engine
145
147
  Stella.stdout.info " AUTH #{domain} (#{user}/#{pass})"
146
148
  end
147
149
 
148
- def update_request_timeout(client_id, usecase, uri, req, params, headers, counter, container)
150
+ def update_request_timeout(client_id, usecase, uri, req, params, headers, counter, container, timeout)
149
151
  Benelux.thread_timeline.add_count :failed, 1
150
- Stella.stdout.info " TIMEOUT %-53s" % [uri]
152
+ Stella.stdout.info " TIMEOUT(%f) %-53s" % [uri, timeout]
151
153
  end
152
154
 
153
155
  end
@@ -441,7 +441,7 @@ module Stella::Engine
441
441
 
442
442
  def update_request_unhandled_exception(client_id, usecase, uri, req, params, ex)
443
443
  Benelux.thread_timeline.add_message ex.message, :kind => :exception
444
- Benelux.thread_timeline.add_count :error, 1
444
+ Benelux.thread_timeline.add_count :exception, 1
445
445
  desc = "#{usecase.desc} > #{req.desc}"
446
446
  if Stella.stdout.lev == 2
447
447
  Stella.stdout.print 2, '.'.color(:red)
@@ -491,12 +491,13 @@ module Stella::Engine
491
491
  Benelux.thread_timeline.add_message args.join('; '), :kind => :authentication
492
492
  end
493
493
 
494
- def update_request_timeout(client_id, usecase, uri, req, params, headers, counter, container)
495
- Stella.stdout.info3 " Client-%s TIMEOUT %-53s" % [client_id.shorter, uri]
496
- Benelux.thread_timeline.add_count :failed, 1
494
+ def update_request_timeout(client_id, usecase, uri, req, params, headers, counter, container, timeout)
495
+ msg = " Client-%s TIMEOUT(%.1f) %-53s" % [client_id.shorter, timeout, uri]
496
+ Stella.stdout.info3 msg
497
+ Benelux.thread_timeline.add_count :exception, 1
497
498
  args = [Time.now.to_f, Stella.sysinfo.hostname, client_id.short]
498
499
  args.push [uri, 'TOUT', container.unique_id[0,10]]
499
- Benelux.thread_timeline.add_message args.join('; '), :kind => :timeout
500
+ Benelux.thread_timeline.add_message msg , :kind => :exception
500
501
  end
501
502
 
502
503
  def self.rescue(client_id, &blk)
@@ -38,7 +38,6 @@ class Testplan < Storable
38
38
  field :description => String
39
39
  #field :resources
40
40
 
41
- # TODO: Add Stellar::TOKEN to the calculation
42
41
  gibbler :usecases, :userid
43
42
 
44
43
  def initialize(*uris)
data/stella.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{stella}
8
- s.version = "0.8.7.001"
8
+ s.version = "0.8.7.002"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Delano Mandelbaum"]
12
- s.date = %q{2010-05-21}
12
+ s.date = %q{2010-06-15}
13
13
  s.default_executable = %q{stella}
14
14
  s.description = %q{Blame Stella for breaking your web application!}
15
15
  s.email = %q{delano@solutious.com}
@@ -51,7 +51,6 @@ end
51
51
 
52
52
  get '/' do
53
53
  @title << " - Search"
54
- #sleep 0.05
55
54
  erb :search_form
56
55
  end
57
56
 
@@ -132,6 +131,12 @@ get '/listings.yaml' do
132
131
  @listings.to_yaml
133
132
  end
134
133
 
134
+ 65.times do |time|
135
+ get "/timeout_#{time}" do
136
+ sleep time
137
+ 'slept for %d' % time
138
+ end
139
+ end
135
140
 
136
141
  before do
137
142
  @cookie = request.cookies["bff-history"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stella
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7.001
4
+ version: 0.8.7.002
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-05-21 00:00:00 -04:00
12
+ date: 2010-06-15 00:00:00 -04:00
13
13
  default_executable: stella
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency