Unit tests (puppet 3.3.x or 3.4.x) random erros : WebMock::NetConnectNotAllowedError

Bug #1492636 reported by Sebastien Badia
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
puppet-ceilometer
Fix Released
Critical
Emilien Macchi
puppet-keystone
Fix Released
Undecided
Emilien Macchi
puppet-nova
Fix Released
Critical
Sebastien Badia
puppet-swift
Fix Released
Critical
Sebastien Badia

Bug Description

It seems that the is_expected.to compile and is_expected.to compile.with_all_deps rspec matchers[1] call all facts and especially the ec2 fact from facter 1.7.6 which open a http connection to the link-local 169.254.169.254[2].

We now load webmock by default (stub are only used in neutron module), and it seem to produce random errors with this rspec matchers. (puppet-nova and puppet-swift are impacted for the moment).

Webmock net connects are disabled by default, a solution is to allow link-local IPv4 for those modules, I take a look

WebMock.disable_net_connect!(:allow => "169.254.169.254")

[1] https://github.com/rodjek/rspec-puppet/blob/master/lib/rspec-puppet/matchers/compile.rb
[2] https://github.com/puppetlabs/facter/blob/cf5203c247f5140f0aa9e6d7b2c89dabf4280416/lib/facter/ec2.rb#L9
[3] http://logs.openstack.org/44/219844/2/gate/gate-puppet-nova-puppet-unit-3.4-dsvm-centos7/27bc199/console.html.gz
[4] http://logs.openstack.org/02/213102/2/gate/gate-puppet-nova-puppet-unit-3.4-dsvm-centos7/7c8ca68/console.html
[5] http://logs.openstack.org/78/189878/6/gate/gate-puppet-swift-puppet-unit-3.3-dsvm-centos7/2aa760a/console.html

Sebastien Badia (sbadia)
Changed in puppet-swift:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Sebastien Badia (sbadia)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/220752

Revision history for this message
Sebastien Badia (sbadia) wrote :

Query added for elastic-rechecks (https://review.openstack.org/220753)

Sebastien Badia (sbadia)
Changed in puppet-ceilometer:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/220761

Changed in puppet-ceilometer:
assignee: nobody → Sebastien Badia (sbadia)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/220762

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-swift (master)

Reviewed: https://review.openstack.org/220762
Committed: https://git.openstack.org/cgit/openstack/puppet-swift/commit/?id=c306830644bd17cc11491b7135c8d027e2ff82c0
Submitter: Jenkins
Branch: master

commit c306830644bd17cc11491b7135c8d027e2ff82c0
Author: Sebastien Badia <email address hidden>
Date: Sun Sep 6 01:35:45 2015 +0200

    spec: Enable webmock connect to IPv4 link-local

    compile and compile.with_all_deps rpsec matchers make
    a call to all facts, and especially the ec2 one (this fact, try
    to make a connection on the IPv4 link-local for ec2 metadata which
    is incompatible with webmock restrictions), this seems to produce
    random errors with puppet 3.{3,4}.x and facter 1.7.6.

    Closes-bug: #1492636
    Change-Id: Ia47236e1c929e8d449bbb43cd2162f3d79d654f7

Changed in puppet-swift:
status: In Progress → Fix Committed
Changed in puppet-nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (master)

Reviewed: https://review.openstack.org/220752
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=be0b9ac1a370f39909c2c8239e5e3279325311dc
Submitter: Jenkins
Branch: master

commit be0b9ac1a370f39909c2c8239e5e3279325311dc
Author: Sebastien Badia <email address hidden>
Date: Sat Sep 5 22:53:15 2015 +0200

    spec: Enable webmock connect to IPv4 link-local

    compile and compile.with_all_deps rpsec matchers make
    a call to all facts, and especially the ec2 one (this fact, try
    to make a connection on the IPv4 link-local for ec2 metadata which
    is incompatible with webmock restrictions), this seems to produce
    random errors with puppet 3.{3,4}.x and facter 1.7.6.

    Change-Id: Ib9b24a899700742ff623231f576ea2bf14141683
    Closes-bug: #1492636

Changed in puppet-ceilometer:
assignee: Sebastien Badia (sbadia) → Emilien Macchi (emilienm)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-ceilometer (master)

Reviewed: https://review.openstack.org/220761
Committed: https://git.openstack.org/cgit/openstack/puppet-ceilometer/commit/?id=60a2c46196d0fdb4675a7482648a85fc928ca0cf
Submitter: Jenkins
Branch: master

commit 60a2c46196d0fdb4675a7482648a85fc928ca0cf
Author: Sebastien Badia <email address hidden>
Date: Sun Sep 6 01:37:30 2015 +0200

    spec: Enable webmock connect to IPv4 link-local

    compile and compile.with_all_deps rpsec matchers make
    a call to all facts, and especially the ec2 one (this fact, try
    to make a connection on the IPv4 link-local for ec2 metadata which
    is incompatible with webmock restrictions), this seems to produce
    random errors with puppet 3.{3,4}.x and facter 1.7.6.

    Closes-bug: #1492636
    Change-Id: If27fa1adca40bab7fdfcb0687b68d1524c961325

Changed in puppet-ceilometer:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/271092

Changed in puppet-keystone:
assignee: nobody → Emilien Macchi (emilienm)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-keystone (master)

Reviewed: https://review.openstack.org/271092
Committed: https://git.openstack.org/cgit/openstack/puppet-keystone/commit/?id=e485f3956f221f2a9db07b7fd851ef06f259a959
Submitter: Jenkins
Branch: master

commit e485f3956f221f2a9db07b7fd851ef06f259a959
Author: Emilien Macchi <email address hidden>
Date: Thu Jan 21 18:52:26 2016 -0500

    spec: Enable webmock connect to IPv4 link-local

    compile and compile.with_all_deps rpsec matchers make a call
    to all facts, and especially the ec2 one (this fact, try to
    make a connection on the IPv4 link-local for ec2
    metadata which is incompatible with webmock restrictions),
    this seems to produce random errors with puppet 3.{3,4}.x
    and facter 1.7.6.

    Change-Id: I154b37854ffd65a649b9af66610882a82435b90f
    Closes-bug: #1492636

Changed in puppet-keystone:
status: In Progress → Fix Released
Changed in puppet-swift:
status: Fix Committed → Fix Released
Changed in puppet-nova:
status: Fix Committed → Fix Released
Changed in puppet-ceilometer:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.