-
Notifications
You must be signed in to change notification settings - Fork 897
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
Scope the default zone to the current region #17103
Conversation
let!(:default_in_my_region) { described_class.create(:name => "default", :description => "Default Zone") } | ||
|
||
it ".default_zone returns a zone in the current region" do | ||
expect(described_class.default_zone).to eq(default_in_my_region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone have a suggestion on how to ensure that this test does not result in a false positive since find_by(:name => "default")
could end up returning the one we want, in the current region without the scoped query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think we have to depend on sporadic test failures to find that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be possible to create a method/block in_region(ApplicationRecord.my_region_number + 1) do ; end
Seems like overkill. I like Brandon's response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
let!(:default_in_my_region) { described_class.create(:name => "default", :description => "Default Zone") } | ||
|
||
it ".default_zone returns a zone in the current region" do | ||
expect(described_class.default_zone).to eq(default_in_my_region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think we have to depend on sporadic test failures to find that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let!(:default_in_my_region) { described_class.create(:name => "default", :description => "Default Zone") } | ||
|
||
it ".default_zone returns a zone in the current region" do | ||
expect(described_class.default_zone).to eq(default_in_my_region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be possible to create a method/block in_region(ApplicationRecord.my_region_number + 1) do ; end
Seems like overkill. I like Brandon's response
This addresses the case where a new server is added to a DB containing multiple regions and the default zone from a remote region is assigned Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1552231
f2259ad
to
be2a49a
Compare
Checked commit gtanzillo@be2a49a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@gtanzillo Can this be |
Scope the default zone to the current region (cherry picked from commit 8a4447a) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1566568
Gaprindashvili backport details:
|
This addresses the case where a new server is added to a DB containing multiple regions and the default
zone from a remote region is assigned
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1552231