Skip to content
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

Failing specs on local machine but not Travis #20986

Closed
Fryguy opened this issue Jan 27, 2021 · 2 comments · Fixed by #21010
Closed

Failing specs on local machine but not Travis #20986

Fryguy opened this issue Jan 27, 2021 · 2 comments · Fixed by #21010
Assignees

Comments

@Fryguy
Copy link
Member

Fryguy commented Jan 27, 2021

There might be more, but these 3 tests consistently fail on my Mac, but pass in Travis...

  1) EvmDatabaseOps#backup without enough free space
     Failure/Error: expect(MiqQueue.where(:class_name => "MiqEvent", :method_name => "raise_evm_event").count).to eq(1)

       expected: 1
            got: 0

       (compared using ==)
     # ./spec/lib/evm_database_ops_spec.rb:53:in `block (3 levels) in <top (required)>'
     # /Users/jfrey/.gem/ruby/2.6.6/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

  2) EvmDatabaseOps#dump without enough free space
     Failure/Error: expect(MiqQueue.where(:class_name => "MiqEvent", :method_name => "raise_evm_event").count).to eq(1)

       expected: 1
            got: 0

       (compared using ==)
     # ./spec/lib/evm_database_ops_spec.rb:133:in `block (3 levels) in <top (required)>'
     # /Users/jfrey/.gem/ruby/2.6.6/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

  3) MiqEnvironment with linux platform Host Info local_ip_address
     Failure/Error: expect(described_class.local_ip_address).to eq(`hostname -i`.chomp.split.first)

       expected: nil
            got: "127.0.0.1"

       (compared using ==)
     # ./spec/lib/miq_environment_spec.rb:18:in `block (4 levels) in <top (required)>'
     # /Users/jfrey/.gem/ruby/2.6.6/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

Failed examples:

rspec ./spec/lib/evm_database_ops_spec.rb:47 # EvmDatabaseOps#backup without enough free space
rspec ./spec/lib/evm_database_ops_spec.rb:126 # EvmDatabaseOps#dump without enough free space
rspec ./spec/lib/miq_environment_spec.rb:17 # MiqEnvironment with linux platform Host Info local_ip_address
@Fryguy Fryguy changed the title Failiing specs on Mac but not Linux Failing specs on Mac but not Linux Jan 27, 2021
@agrare
Copy link
Member

agrare commented Jan 27, 2021

@Fryguy I don't think this is mac/linux as these three fail for me as well. It is more likely a travis environmental / config thing

The last one I actually get 127.0.1.1 not nil:

  3) MiqEnvironment with linux platform Host Info local_ip_address
     Failure/Error: expect(described_class.local_ip_address).to eq(`hostname -i`.chomp.split.first)
     
       expected: "127.0.1.1"
            got: "127.0.0.1"
     
       (compared using ==)
     # ./spec/lib/miq_environment_spec.rb:18:in `block (4 levels) in <top (required)>'
     # /home/grare/adam/.gem/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

@Fryguy Fryguy changed the title Failing specs on Mac but not Linux Failing specs on local machine but not Travis Jan 27, 2021
@Fryguy
Copy link
Member Author

Fryguy commented Jan 27, 2021

Thanks @agrare I updated the title

@Fryguy Fryguy removed the help wanted label Feb 3, 2021
@Fryguy Fryguy self-assigned this Feb 3, 2021
Fryguy added a commit to Fryguy/manageiq that referenced this issue Feb 3, 2021
Fryguy added a commit to Fryguy/manageiq that referenced this issue Feb 3, 2021
The test is checking that MiqEvents were raised to the queue when space
is not available for the backup/dump feature, however depending on test
loading order, it's possible that MiqEvent is not defined.  The code
that raises the event has an explicit check for `defined?(::MiqEvent)`
because it can run outside of the Rails environment context from a rake
task.

This commit changes the test to ensure that the MiqEvent class is
defined, so we can verify that the event is raised.

Closes ManageIQ#20986
Fryguy added a commit to Fryguy/manageiq that referenced this issue Feb 3, 2021
The test is checking that MiqEvents were raised to the queue when space
is not available for the backup/dump feature, however depending on test
loading order, it's possible that MiqEvent is not defined.  The code
that raises the event has an explicit check for `defined?(::MiqEvent)`
because it run outside of the Rails environment context from a rake
task.

This commit changes the test to ensure that the MiqEvent class is
defined, so we can verify that the event is raised.

Closes ManageIQ#20986
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants