-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(FACT-3465) Order dependent failures #2715
Merged
cthorn42
merged 5 commits into
puppetlabs:main
from
joshcooper:order-dependent-failures
May 23, 2024
Merged
(FACT-3465) Order dependent failures #2715
cthorn42
merged 5 commits into
puppetlabs:main
from
joshcooper:order-dependent-failures
May 23, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
joshcooper
force-pushed
the
order-dependent-failures
branch
2 times, most recently
from
May 17, 2024 21:19
b4ec575
to
faa5a1b
Compare
joshcooper
commented
May 17, 2024
joshcooper
force-pushed
the
order-dependent-failures
branch
from
May 17, 2024 21:29
faa5a1b
to
b880f0d
Compare
The uname spec set a logger class variable on the uname resolver which leaked into the processor spec. This wasn't noticed until the processor resolver was modified to call the uname resolver. So the instance spy from the uname resolver spec leaked into the processor spec: C:\> bundle exec rspec -fd .\spec\facter\resolvers\uname_spec.rb:32 .\spec\facter\resolvers\processors_spec.rb:182 ... 1) Facter::Resolvers::Linux::Processors when on powerpc architecture returns list of models Failure/Error: logger.debug(format(STDERR_MESSAGE, command, msg.strip)) #<InstanceDouble(Facter::Log) (anonymous)> was originally created in one example but has leaked into another example and can no longer be used.
Running the ec2_spec test in isolation failed on Windows because the call to Socket.tcp would timeout and skip the rest of the code being tested.
The RSpec `allow` method creates a proxy object to wrap the original object. This way it can intercept calls to the original object that are "allowed". However, if the proxy receives a method that isn't allowed, then it will raise an RSpec exception. Several tests were rescuing the RSpec exception, but still passing (for the wrong reason). The rule is if you stub an object and it might be called with other arguments, then you need to add `and_call_original`. This is especially true for File.exist? because it's called by rubygems.
We use instance_spys for the logger everywhere else.
Previously if neither /sur/sbin/xl nor xm existed, then the `find_command` method returned the array of XEN_COMMANDS. Since that wasn't nil, the resolver tried to execute the Array of commands and failed (for the wrong reason). Now explicitly return nil in the case neither file exists.
joshcooper
force-pushed
the
order-dependent-failures
branch
from
May 20, 2024 16:50
b880f0d
to
d857633
Compare
joshcooper
changed the title
Order dependent failures
(FACT-3465) Order dependent failures
May 20, 2024
cthorn42
approved these changes
May 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the uname resolver set an instance_spy logger, but didn't clear it. If the uname spec was run first, followed by another spec whose resolver relied on the uname resolver, then the instance_spy would leak across specs. This clears the logger and fixes several tests that were passing for the wrong reasons.
The "loggers leak across tests" is a general issue. It will be fixed in a separate issue: