grntest 1.1.9 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d61393e0186647b014a4b66f3410d5f419a00438
4
- data.tar.gz: 6a1504fa74e60166dd9846e0b620f9d98b701f6f
3
+ metadata.gz: c1eaa6113280fa4fd998676aefad9f96fe7dd6c1
4
+ data.tar.gz: 90996c0c6d5f98167cbf46a60365837de1755e67
5
5
  SHA512:
6
- metadata.gz: c38aebc58a3d4b0d3140ab69fbc3ab2ce433b8f2db3f6248fedc27773c1bba0b3dcc7e5b0cd47d9ba4f0763f4095dd3eab74b95ec46a66362b6065add32fde55
7
- data.tar.gz: 5190437778add09f73751040dc418f9b219d209ba79d81ddb67dc81152398a250d04380e109ccaac158f5439fb3380054a5bdcf183b3d2e02550bc3b8599b906
6
+ metadata.gz: dcf4cab75f97aec997435e31b845caba4f051e8b81b60d61dddcb0ca78d5af10723bc1dbd5cbfd9404b8dbafe3a39489b859df070e59ca38d832bb7301d4e71b
7
+ data.tar.gz: 4fa7f1859c11aa24e095e43d1ff15ddccc5f595b72971fcf35508dcde4b86a466069675a892f61b1a9fc2a58fc6f74ecbcf595e295e54e103ebcb453850c989b
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.2.0: 2016-05-18
4
+
5
+ ### Improvements
6
+
7
+ * Improved shutdown on `--interface stdio`.
8
+
3
9
  ## 1.1.9: 2016-05-17
4
10
 
5
11
  ### Improvements
@@ -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
- Process.waitpid(pid) if pid
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, shutdown_wait_timeout)
367
- pid = nil if wait_pid(pid, shutdown_wait_timeout)
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, shutdown_wait_timeout)
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, timeout)
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 > timeout
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, timeout)
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 > timeout
414
+ break if total_sleep_time > @shutdown_wait_timeout
412
415
  end
413
416
  true
414
417
  end
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.1.9"
17
+ VERSION = "1.2.0"
18
18
  end
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.1.9
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-17 00:00:00.000000000 Z
12
+ date: 2016-05-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json