We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 584443d commit 104f0eaCopy full SHA for 104f0ea
spec/integration/type/exec_spec.rb
@@ -75,6 +75,19 @@
75
end
76
77
78
+ context 'when an exec sends an EOF' do
79
+ let(:command) { ["/bin/bash", "-c", "exec /bin/sleep 1 >/dev/null 2>&1"] }
80
+
81
+ it 'should not take significant user time' do
82
+ exec = described_class.new :command => command, :path => ENV['PATH']
83
+ catalog.add_resource exec
84
+ timed_apply = Benchmark.measure { catalog.apply }
85
+ # In testing I found the user time before the patch in 4f35fd262e to be above
86
+ # 0.3, after the patch it was consistently below 0.1 seconds.
87
+ expect(timed_apply.utime).to be < 0.3
88
+ end
89
90
91
context 'when command is a string' do
92
let(:command) { "ruby -e 'File.open(\"#{path}\", \"w\") { |f| f.print \"foo\" }'" }
93
0 commit comments