beaker 4.11.0 → 4.11.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/CHANGELOG.md +6 -0
- data/lib/beaker/host.rb +2 -1
- data/lib/beaker/shared/repetition.rb +6 -0
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host_spec.rb +3 -4
- 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: c1a8549e026be5a3fa83b131174cab1fe2407950
|
|
4
|
+
data.tar.gz: 0ca7f821905cc7195e0c05bdf47aa440e85bf9db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 340af3a743fefc91288adba7e6105de325f6b3f023559e72bb9969e14dce916514fe47fb978bdbbafc25f701d41776afb471dbf3c45b24259c3404f8cc2f251c
|
|
7
|
+
data.tar.gz: 8e7b8dad8e1cdd62d063cabae50cb6b2090b74e68429fa803e93da905d781a0d9bd2117d5b0adec3c75655e2118a82df775068192b9d4ad462198685b2f9bda6
|
data/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,12 @@ git logs & PR history.
|
|
|
13
13
|
|
|
14
14
|
# [Unreleased](https://github.com/puppetlabs/beaker/compare/4.11.0...master)
|
|
15
15
|
|
|
16
|
+
# [4.11.1](https://github.com/puppetlabs/beaker/compare/4.11.0...4.11.1) - 2019-08-13
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- `host.down?`'s wait from a fibonacci to a constant wait (BKR-1595)
|
|
21
|
+
|
|
16
22
|
# [4.11.0](https://github.com/puppetlabs/beaker/compare/4.10.0...4.11.0) - 2019-07-22
|
|
17
23
|
|
|
18
24
|
### Added
|
data/lib/beaker/host.rb
CHANGED
|
@@ -599,7 +599,8 @@ module Beaker
|
|
|
599
599
|
def down?
|
|
600
600
|
@logger.debug("host.down?: checking if host has gone down using ping...")
|
|
601
601
|
host_up = true
|
|
602
|
-
|
|
602
|
+
# give it max 3 minutes to go down, check every 10 seconds
|
|
603
|
+
repeat_for_and_wait 180, 10 do
|
|
603
604
|
host_up = self.ping?
|
|
604
605
|
@logger.debug("- ping result: #{host_up}. Done checking? #{!host_up}")
|
|
605
606
|
!host_up # host down? -> continue looping. up? -> finished
|
|
@@ -3,10 +3,16 @@ module Beaker
|
|
|
3
3
|
module Repetition
|
|
4
4
|
|
|
5
5
|
def repeat_for seconds, &block
|
|
6
|
+
# do not peg CPU if &block takes less than 1 second
|
|
7
|
+
repeat_for_and_wait seconds, 1, &block
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def repeat_for_and_wait seconds, wait, &block
|
|
6
11
|
timeout = Time.now + seconds
|
|
7
12
|
done = false
|
|
8
13
|
until done or timeout < Time.now do
|
|
9
14
|
done = block.call
|
|
15
|
+
sleep wait unless done
|
|
10
16
|
end
|
|
11
17
|
return done
|
|
12
18
|
end
|
data/lib/beaker/version.rb
CHANGED
data/spec/beaker/host_spec.rb
CHANGED
|
@@ -827,12 +827,11 @@ module Beaker
|
|
|
827
827
|
|
|
828
828
|
describe "#down?" do
|
|
829
829
|
|
|
830
|
-
it "repeats
|
|
831
|
-
allow(host).to receive(:
|
|
832
|
-
expect(host).to receive(:ping?).exactly(11).times.and_return(true)
|
|
830
|
+
it "repeats & fails with 'failed to go down' after X seconds" do
|
|
831
|
+
allow(host).to receive(:repeat_for_and_wait).with(180,10).and_return(false)
|
|
833
832
|
expect {
|
|
834
833
|
host.down?
|
|
835
|
-
}.to raise_error(Beaker::Host::RebootFailure,
|
|
834
|
+
}.to raise_error(Beaker::Host::RebootFailure, "Host failed to go down")
|
|
836
835
|
end
|
|
837
836
|
|
|
838
837
|
it "returns that the host is down (true) if ping? is false" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beaker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.11.
|
|
4
|
+
version: 4.11.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppet
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|