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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e9ddb99c16ca4103cc2836b35a440dc9db6db6f
4
- data.tar.gz: eff6a1f77989d1a28e1e488d99eaa7d89677ded0
3
+ metadata.gz: c1a8549e026be5a3fa83b131174cab1fe2407950
4
+ data.tar.gz: 0ca7f821905cc7195e0c05bdf47aa440e85bf9db
5
5
  SHA512:
6
- metadata.gz: f19c58ffdfb656152da9c875e61dd12b8ac7b2a96b8186c04c5b791ffc907e7571c23be0b8db3b0c37751d0d25585f681226239847b88d5c1819a496cc97fa58
7
- data.tar.gz: fe6f360fd641e876a0193d1561506ffe8efa716d9904be6a13ba55763a65050e7e16881077c5f22ca796bfce9cb34601046e5970bd31c9dab12a9ee5920d61a8
6
+ metadata.gz: 340af3a743fefc91288adba7e6105de325f6b3f023559e72bb9969e14dce916514fe47fb978bdbbafc25f701d41776afb471dbf3c45b24259c3404f8cc2f251c
7
+ data.tar.gz: 8e7b8dad8e1cdd62d063cabae50cb6b2090b74e68429fa803e93da905d781a0d9bd2117d5b0adec3c75655e2118a82df775068192b9d4ad462198685b2f9bda6
@@ -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
@@ -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
- repeat_fibonacci_style_for 11 do
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
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '4.11.0'
3
+ STRING = '4.11.1'
4
4
  end
5
5
  end
@@ -827,12 +827,11 @@ module Beaker
827
827
 
828
828
  describe "#down?" do
829
829
 
830
- it "repeats 11 times & fails if ping never returns false" do
831
- allow(host).to receive(:sleep)
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, /failed to go down/)
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.0
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-07-22 00:00:00.000000000 Z
11
+ date: 2019-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec