codeclimate 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc38b173427463ad6d16b71d72c98c76490ef456
4
- data.tar.gz: 6157f5687722c22692b139cddc27c3c7473b6370
3
+ metadata.gz: 38fba4f67389a2824e38e0fe2bc6d6bab49bca4c
4
+ data.tar.gz: 9d0cecd1caa99220b028f3b789cc0386f09f67ea
5
5
  SHA512:
6
- metadata.gz: 956eef4be2eafa19949b8028eae6886d6b4b10d5047c6226103cc3883e0ab27f2f53111991e81d2fa02b638a1fc56d2d405b3231a9ea052a7b98c4aee1bd40b6
7
- data.tar.gz: 34fceeccebed12b3d044d16dfa00ed16e1f935ebb39d973d6ca8206a3f918c09026c5cd1890e105ca25c14e7de969be51b9924a1a9b4a5166ab504ef9d28eb3a
6
+ metadata.gz: 09e8478a66d99268866a09c31896cafb9d1dace0b684ca43c764491ae8823375973af9a5edb9aa02eb78f3cfb9245e06723e986afd3bbd488023dd8c6c50fc0b
7
+ data.tar.gz: 0e71a463a9d87e5f35c06f0902c2c9c020a3d761b7506f1217fa416b6881e163e2afd6644b657fdcd1c34f07884d4edd2ae74ce29e4db715a97bff726228c091
@@ -44,13 +44,13 @@ module CC
44
44
  started = Time.now
45
45
  @listener.started(container_data)
46
46
 
47
- pid, _, out, err = POSIX::Spawn.popen4(*docker_run_command(options))
47
+ @pid, _, out, err = POSIX::Spawn.popen4(*docker_run_command(options))
48
48
 
49
49
  t_out = read_stdout(out)
50
50
  t_err = read_stderr(err)
51
- t_timeout = timeout_thread(pid)
51
+ t_timeout = timeout_thread(@pid)
52
52
 
53
- _, status = Process.waitpid2(pid)
53
+ _, status = Process.waitpid2(@pid)
54
54
 
55
55
  duration = ((Time.now - started) * 1000).round
56
56
  @listener.finished(container_data(duration: duration, status: status))
@@ -69,6 +69,15 @@ module CC
69
69
  end
70
70
  end
71
71
 
72
+ def stop
73
+ # Prevents the processing of more output after first error
74
+ @on_output = ->(*) { }
75
+
76
+ Process.kill("TERM", @pid) if @pid
77
+ rescue Errno::ESRCH
78
+ Analyzer.statsd.increment("container.kill_process_rescue")
79
+ end
80
+
72
81
  private
73
82
 
74
83
  def docker_run_command(options)
@@ -33,7 +33,7 @@ module CC
33
33
 
34
34
  container.on_output("\0") do |output|
35
35
  unless output_filter.filter?(output)
36
- stdout_io.write(output)
36
+ stdout_io.write(output) || container.stop
37
37
  end
38
38
  end
39
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate