Bug 791216
Summary: | Tests for Aeolus::Image::Factory::Base with OAuth randomly fails | ||
---|---|---|---|
Product: | [Retired] CloudForms Cloud Engine | Reporter: | Petr Blaho <pblaho> |
Component: | aeolus-all | Assignee: | Petr Blaho <pblaho> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | wes hayutin <whayutin> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 1.0.0 | CC: | akarol, deltacloud-maint, slinaber, ssachdev |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | v0.3.0-10 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-08-30 17:14:23 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Petr Blaho
2012-02-16 14:27:07 UTC
There is a problem with hash argument passed to ActiveRecord::Connection.request method. VCR is set up to match requests by uri, method and body. But hash has no specified order of keys, so sometimes that hash argument translates to body not matched by VCR. To avoid this and to improve overall structure of tests I will refactor this tests to use separate VCR cassette for each test - now these tests use one common VCR cassette. Posted patch for problematic tests: https://fedorahosted.org/pipermail/aeolus-devel/2012-February/009099.html Resent after some comments on list. Patch is divided into two parts - one renaming spec files and second solution to bug. https://fedorahosted.org/pipermail/aeolus-devel/2012-February/009125.html Pushed to master: commit 91a9e528f61826657268ac127d501a6727e13dff Author: Petr Blaho <pblaho> Date: Thu Feb 23 15:14:11 2012 +0100 Resolve VCR problem with matching requests Refactored some tests code to bypass VCR request matching problem https://bugzilla.redhat.com/show_bug.cgi?id=791216 commit 64216740e436e5ebcd5ec93801d1915b5b0df053 Author: Petr Blaho <pblaho> Date: Thu Feb 23 14:57:43 2012 +0100 Rename of some spec files - add _spec suffix https://bugzilla.redhat.com/show_bug.cgi?id=791216 5c1dcce4b29ab840e915b9401cb170ad57c3f985 Pulled the source code ==================================================== git clone git://github.com/aeolusproject/aeolus-image-rubygem.git Initialized empty Git repository in /root/aeolus-image-rubygem/.git/ remote: Counting objects: 963, done. remote: Compressing objects: 100% (363/363), done. remote: Total 963 (delta 569), reused 961 (delta 567) Receiving objects: 100% (963/963), 153.60 KiB, done. Resolving deltas: 100% (569/569), done. =============================================== [root@qe-blade-14 ~]# cd aeolus-image-rubygem/ [root@qe-blade-14 aeolus-image-rubygem]# ll total 44 -rw-r--r--. 1 root root 760 Mar 1 08:41 aeolus-image.gemspec -rw-r--r--. 1 root root 9141 Mar 1 08:41 COPYING drwxr-xr-x. 2 root root 4096 Mar 1 08:41 examples drwxr-xr-x. 3 root root 4096 Mar 1 08:41 lib drwxr-xr-x. 2 root root 4096 Mar 1 08:41 rake -rw-r--r--. 1 root root 2418 Mar 1 08:41 Rakefile -rw-r--r--. 1 root root 1237 Mar 1 08:41 README.md -rw-r--r--. 1 root root 3778 Mar 1 08:41 rubygem-aeolus-image.spec.in drwxr-xr-x. 5 root root 4096 Mar 1 08:41 spec [root@qe-blade-14 aeolus-image-rubygem]# rake spec SPEC=spec/models/factory/base_spec.rb /usr/bin/ruby -S rspec spec/models/factory/base_spec.rb /root/aeolus-image-rubygem/lib/aeolus_image/model/warehouse/image.rb:19: warning: already initialized constant OS Aeolus::Image::Factory::Base should not use_oauth? if configuration is missing should use_oauth? if configuration is present should succeed with valid OAuth credentials should fail with invalid OAuth credentials should fail with no OAuth credentials Finished in 0.08629 seconds 5 examples, 0 failures [root@qe-blade-14 aeolus-image-rubygem]# rake spec SPEC=spec/models/factory/base_spec.rb /usr/bin/ruby -S rspec spec/models/factory/base_spec.rb /root/aeolus-image-rubygem/lib/aeolus_image/model/warehouse/image.rb:19: warning: already initialized constant OS Aeolus::Image::Factory::Base should not use_oauth? if configuration is missing should use_oauth? if configuration is present should succeed with valid OAuth credentials should fail with invalid OAuth credentials should fail with no OAuth credentials Finished in 0.0859 seconds 5 examples, 0 failures [root@qe-blade-14 aeolus-image-rubygem]# rake spec SPEC=spec/models/factory/base_spec.rb /usr/bin/ruby -S rspec spec/models/factory/base_spec.rb /root/aeolus-image-rubygem/lib/aeolus_image/model/warehouse/image.rb:19: warning: already initialized constant OS Aeolus::Image::Factory::Base should not use_oauth? if configuration is missing should use_oauth? if configuration is present should succeed with valid OAuth credentials should fail with invalid OAuth credentials should fail with no OAuth credentials Finished in 0.08575 seconds 5 examples, 0 failures [root@qe-blade-14 aeolus-image-rubygem]# rake spec SPEC=spec/models/factory/base_spec.rb /usr/bin/ruby -S rspec spec/models/factory/base_spec.rb /root/aeolus-image-rubygem/lib/aeolus_image/model/warehouse/image.rb:19: warning: already initialized constant OS Aeolus::Image::Factory::Base should not use_oauth? if configuration is missing should use_oauth? if configuration is present should succeed with valid OAuth credentials should fail with invalid OAuth credentials should fail with no OAuth credentials Finished in 0.08587 seconds 5 examples, 0 failures [root@qe-blade-14 aeolus-image-rubygem]# rake spec SPEC=spec/models/factory/base_spec.rb /usr/bin/ruby -S rspec spec/models/factory/base_spec.rb /root/aeolus-image-rubygem/lib/aeolus_image/model/warehouse/image.rb:19: warning: already initialized constant OS Aeolus::Image::Factory::Base should not use_oauth? if configuration is missing should use_oauth? if configuration is present should succeed with valid OAuth credentials should fail with invalid OAuth credentials should fail with no OAuth credentials Finished in 0.0861 seconds 5 examples, 0 failures [root@qe-blade-14 aeolus-image-rubygem]# rake spec SPEC=spec/models/factory/base_spec.rb <pblaho> git://github.com/aeolusproject/aeolus-image-rubygem.git <pblaho> cd aeolus-image-rubygem <pblaho> the same rake command <pblaho> the problem was in random order of keys in body of one request <pblaho> so it occured in 50/50 <pblaho> just run it maybe 10 or so and if it will not fail it is ok <pblaho> it seems ok all tests passed |