puppetlabs/puppet — pull request #336 by joshcooper (2012-01-16 00:36:26+00:00)
Title: (maint) Fix time-dependent certificate factory spec tests

Some of the certificate factory spec tests were trying to ensure that
the certificate factory's ttl was being applied when signing a
certificate's `not_after` time. However, the tests did not take into
account the amount of time it takes to sign the certificate, which can
be non-negligible.

As a result, the absolute difference between `not_after` and `Time.now +
ttl` was somtimes greater than or equal to 1 second, causing sporadic
test failures.

This commit changes the tests to be less time dependent by ensuring the
difference is within 30 seconds (for both `not_before` and `not_after`)