bake-toolkit 2.37.0 → 2.37.1
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 +4 -4
- data/bin/bakeqac +11 -3
- data/lib/common/process.rb +22 -8
- data/lib/common/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: 4231ba10a8dbc7711dac892e7b932faf30050404
|
4
|
+
data.tar.gz: 4cf03457745cf2bfe3521db89d7847607e160820
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b900fde5e96ff7eadb477bf6856bcd45a4eb4c2c57aa2399b95eaa6060a19dbb53af56ec8bd6ea05b53521662681fb5eabe6d87b04d7efa90e12ec678ec03280
|
7
|
+
data.tar.gz: a572d8d68f5cd1761db7f46af0222cdc3412fd73ee4d4284d21df66ad422394184313964c1dddaf4a7e32b897e9778dd33fbe5a5c4127c7aa4311d1af6220452
|
data/bin/bakeqac
CHANGED
@@ -42,12 +42,15 @@ def self.executeQacli(cmd, adminStepAndImmediateOutput = false)
|
|
42
42
|
qacDaemonError = false
|
43
43
|
consoleOutput = ""
|
44
44
|
success = false
|
45
|
+
processTimeout = false
|
45
46
|
|
46
47
|
loop do
|
47
48
|
FileUtils.rm_rf @options.qacdata if adminStepAndImmediateOutput
|
48
|
-
|
49
|
+
# admin step should not take longer than 30 seconds
|
50
|
+
success, consoleOutput = ProcessHelper.run(cmd, adminStepAndImmediateOutput, true, nil, [0], Dir.pwd, adminStepAndImmediateOutput ? 60 : 0)
|
49
51
|
licenseError = false
|
50
52
|
qacDaemonError = false
|
53
|
+
processTimeout = false
|
51
54
|
|
52
55
|
consoleOutput.each_line do |line|
|
53
56
|
if (line.include?("License Refused") && !line.include?("License Refused: C:"))
|
@@ -60,14 +63,19 @@ def self.executeQacli(cmd, adminStepAndImmediateOutput = false)
|
|
60
63
|
puts "Unable to connect to QAX Daemon!"
|
61
64
|
break
|
62
65
|
end
|
66
|
+
if (line.include?("Process timeout"))
|
67
|
+
puts "Process takes too long!"
|
68
|
+
processTimeout = true
|
69
|
+
break
|
70
|
+
end
|
63
71
|
end
|
64
72
|
|
65
73
|
cSizeCheck = checkCipSize()
|
66
74
|
|
67
|
-
break unless ((@options.qacretry >= (Time.now - timeStart)) && (!cSizeCheck || licenseError || qacDaemonError))
|
75
|
+
break unless ((@options.qacretry >= (Time.now - timeStart)) && (!cSizeCheck || licenseError || qacDaemonError || processTimeout))
|
68
76
|
puts "Retry seconds left: %d" % (@options.qacretry - (Time.now - timeStart))
|
69
77
|
end
|
70
|
-
checkError = !cSizeCheck || licenseError || qacDaemonError
|
78
|
+
checkError = !cSizeCheck || licenseError || qacDaemonError || processTimeout
|
71
79
|
if @options.qacretry > 0 && checkError
|
72
80
|
puts "Retry timeout over: %d -> failure." % (@options.qacretry - (Time.now - timeStart))
|
73
81
|
end
|
data/lib/common/process.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
require 'timeout'
|
2
|
+
|
1
3
|
module Bake
|
2
4
|
|
3
5
|
class ProcessHelper
|
4
6
|
@@pid = nil
|
5
7
|
@@rd = nil
|
6
8
|
|
7
|
-
def self.run(cmdLineArray, immediateOutput=false, force=true, outpipe=nil, exitCodeArray = [0], dir = Dir.pwd)
|
9
|
+
def self.run(cmdLineArray, immediateOutput=false, force=true, outpipe=nil, exitCodeArray = [0], dir = Dir.pwd, timeout = 0)
|
8
10
|
rd, wr = IO.pipe
|
9
11
|
@@rd = force ? rd : nil
|
10
12
|
duppedCmdLineArray = cmdLineArray.dup
|
@@ -18,16 +20,27 @@ module Bake
|
|
18
20
|
wr.close
|
19
21
|
output = ""
|
20
22
|
begin
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
tmp.
|
25
|
-
tmp
|
26
|
-
|
23
|
+
begin
|
24
|
+
Timeout::timeout(timeout) {
|
25
|
+
while not rd.eof?
|
26
|
+
tmp = rd.read(1)
|
27
|
+
if (tmp != nil)
|
28
|
+
tmp.encode!('UTF-8', :invalid => :replace, :undef => :replace, :replace => '')
|
29
|
+
tmp.encode!('binary', :invalid => :replace, :undef => :replace, :replace => '')
|
30
|
+
output << tmp
|
27
31
|
|
28
|
-
|
32
|
+
print tmp if immediateOutput
|
33
|
+
end
|
29
34
|
end
|
35
|
+
}
|
36
|
+
rescue Timeout::Error
|
37
|
+
@@rd = rd
|
38
|
+
@@pid = pid
|
39
|
+
ProcessHelper::killProcess(true)
|
40
|
+
output << "Process timeout (#{timeout} seconds).\n"
|
41
|
+
return [false, output]
|
30
42
|
end
|
43
|
+
|
31
44
|
rescue
|
32
45
|
# Seems to be a bug in ruby: sometimes there is a bad file descriptor on Windows instead of eof, which causes
|
33
46
|
# an exception on read(). However, this happens not before everything is read, so there is no practical difference
|
@@ -40,6 +53,7 @@ module Bake
|
|
40
53
|
rescue
|
41
54
|
end
|
42
55
|
pid, status = Process.wait2(pid)
|
56
|
+
|
43
57
|
@@pid = nil
|
44
58
|
@@rd = nil
|
45
59
|
|
data/lib/common/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.37.
|
4
|
+
version: 2.37.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Schaal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|