grntest 1.1.9 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +6 -0
- data/lib/grntest/test-runner.rb +12 -9
- data/lib/grntest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1eaa6113280fa4fd998676aefad9f96fe7dd6c1
|
4
|
+
data.tar.gz: 90996c0c6d5f98167cbf46a60365837de1755e67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcf4cab75f97aec997435e31b845caba4f051e8b81b60d61dddcb0ca78d5af10723bc1dbd5cbfd9404b8dbafe3a39489b859df070e59ca38d832bb7301d4e71b
|
7
|
+
data.tar.gz: 4fa7f1859c11aa24e095e43d1ff15ddccc5f595b72971fcf35508dcde4b86a466069675a892f61b1a9fc2a58fc6f74ecbcf595e295e54e103ebcb453850c989b
|
data/doc/text/news.md
CHANGED
data/lib/grntest/test-runner.rb
CHANGED
@@ -39,6 +39,7 @@ module Grntest
|
|
39
39
|
@expected = nil
|
40
40
|
@n_leaked_objects = 0
|
41
41
|
@omitted = false
|
42
|
+
@shutdown_wait_timeout = 5
|
42
43
|
end
|
43
44
|
|
44
45
|
def status
|
@@ -228,7 +229,10 @@ module Grntest
|
|
228
229
|
end
|
229
230
|
end
|
230
231
|
ensure
|
231
|
-
|
232
|
+
if pid
|
233
|
+
pid = nil if wait_pid(pid)
|
234
|
+
ensure_process_finished(pid)
|
235
|
+
end
|
232
236
|
end
|
233
237
|
end
|
234
238
|
|
@@ -339,7 +343,6 @@ call chdir("#{context.temporary_directory_path}")
|
|
339
343
|
command_line = groonga_http_command(host, port, pid_file_path, context,
|
340
344
|
spawn_options)
|
341
345
|
pid = nil
|
342
|
-
shutdown_wait_timeout = 5
|
343
346
|
options = {
|
344
347
|
:read_timeout => @tester.timeout,
|
345
348
|
}
|
@@ -363,14 +366,14 @@ call chdir("#{context.temporary_directory_path}")
|
|
363
366
|
yield(executor)
|
364
367
|
ensure
|
365
368
|
pid = nil if executor.shutdown(pid)
|
366
|
-
if wait_groonga_http_shutdown(pid_file_path
|
367
|
-
pid = nil if wait_pid(pid
|
369
|
+
if wait_groonga_http_shutdown(pid_file_path)
|
370
|
+
pid = nil if wait_pid(pid)
|
368
371
|
end
|
369
372
|
end
|
370
373
|
ensure
|
371
374
|
return if pid.nil?
|
372
375
|
Process.kill(:TERM, pid)
|
373
|
-
wait_groonga_http_shutdown(pid_file_path
|
376
|
+
wait_groonga_http_shutdown(pid_file_path)
|
374
377
|
ensure_process_finished(pid)
|
375
378
|
end
|
376
379
|
end
|
@@ -389,18 +392,18 @@ call chdir("#{context.temporary_directory_path}")
|
|
389
392
|
end
|
390
393
|
end
|
391
394
|
|
392
|
-
def wait_pid(pid
|
395
|
+
def wait_pid(pid)
|
393
396
|
total_sleep_time = 0
|
394
397
|
sleep_time = 0.1
|
395
398
|
loop do
|
396
399
|
return true if Process.waitpid(pid, Process::WNOHANG)
|
397
400
|
sleep(sleep_time)
|
398
401
|
total_sleep_time += sleep_time
|
399
|
-
return false if total_sleep_time >
|
402
|
+
return false if total_sleep_time > @shutdown_wait_timeout
|
400
403
|
end
|
401
404
|
end
|
402
405
|
|
403
|
-
def wait_groonga_http_shutdown(pid_file_path
|
406
|
+
def wait_groonga_http_shutdown(pid_file_path)
|
404
407
|
return false unless pid_file_path.exist?
|
405
408
|
|
406
409
|
total_sleep_time = 0
|
@@ -408,7 +411,7 @@ call chdir("#{context.temporary_directory_path}")
|
|
408
411
|
while pid_file_path.exist?
|
409
412
|
sleep(sleep_time)
|
410
413
|
total_sleep_time += sleep_time
|
411
|
-
break if total_sleep_time >
|
414
|
+
break if total_sleep_time > @shutdown_wait_timeout
|
412
415
|
end
|
413
416
|
true
|
414
417
|
end
|
data/lib/grntest/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grntest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|