Bug #2567

Some specs slow & may be doing DNS

Added by Markus Roberts about 1 year ago. Updated 9 months ago.

Status:Closed Start:08/24/2009
Priority:Normal Due date:
Assignee:James Turnbull % Done:

0%

Category:network
Target version:0.25.2
Affected version:0.25.0 Branch:http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2567
Keywords:
Votes: 0

Description

Some of the spec tests (e.g. spec/unit/network/authstore.rb) run at wildly different speeds depending on which tests have run before and (possibly) on the state of the local network connection.

The suspicion is that some library is doing reverse DNS lookup or something of the sort.


Related issues

related to Puppet - Bug #2708: Puppet highly dependent on the reverse DNS Closed 10/08/2009

Associated revisions

Revision 857047d956aa0e78e105df2330346dbd6fcd8c35
Added by Markus Roberts 9 months ago

Fix for #2567 (Authstore does unintended/pointless DNS lookups)

This patch fixes #2567 by always pre-validating IP addresses with a strict regular expression check before calling IPAddr.new() on them.

History

Updated by Markus Roberts 12 months ago

To reproduce, run “spec spec/unit/network/authstore.rb” with slow, fast, and no network connection. Takes ~2 seconds with no network or a fast network, and ~10 with a slow network.

Updated by Markus Roberts 9 months ago

  • Target version set to 0.25.2

Updated by Markus Roberts 9 months ago

  • Category changed from testing to network
  • Status changed from Accepted to Ready for Testing
  • Priority changed from Low to Normal
  • Branch set to http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2567

This turned out to be an actual bug in the code rather than just a testing issue; due to the tangled logic it was doing DNS lookups on all non-numeric patterns as they came in (including things like “10.20.30.$1” and “100.101.*”). The variable test times were just a symptom.

Branch up at http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2567

Updated by Markus Roberts 9 months ago

  • Assignee changed from Markus Roberts to James Turnbull

Updated by James Turnbull 9 months ago

  • Status changed from Ready for Testing to Closed

Pushed as commit:“857047d956aa0e78e105df2330346dbd6fcd8c35” and commit:“dddbd2821b6602a8d358de1313553dc25b37a998” and commit:“18c5165bea26151d446ff9ae63aeee108cb210ef” in branch 0.25.x

Also available in: Atom PDF