-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(storage): correct direct connectivity check #11152
Conversation
storage/integration_test.go
Outdated
err = CheckDirectConnectivitySupported(ctx, newMRBucketName) | ||
if err == nil { | ||
t.Fatalf("CheckDirectConnectivitySupported: error expected, got nil") | ||
} |
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.
So this covers the multi-regional case. Should we add a few more cases? I think we should cover:
- single region, same region as VM (expect success)
- single region, diff region from VM (fail)
Same thing with dual region and multiregion.
We could probably refactor this as a table driven test to make it clearer.
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.
make sense! i'll work that next. thanks
storage/integration_test.go
Outdated
} | ||
if err != nil && !strings.Contains(err.Error(), "direct connectivity not detected") { | ||
t.Fatalf("CheckDirectConnectivitySupported: failed on a different error %v", err) | ||
if v, exists := attrs.Value("cloud.platform"); !exists || v.AsString() == "gcp_compute_engine" { |
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.
Does this actually run in Kokoro or trigger the skip?
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.
I'll trigger a job in kokoro; i was testing this in GCE first
storage/integration_test.go
Outdated
} | ||
gceRegion := v.AsString() | ||
var otherRegion string | ||
for _, r := range []string{"us-west1", "us-east1", "us-central1"} { |
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.
Why does this need 3 regions if we're only picking one other?
Maybe just pick some non-US region that we never use for testing?
storage/integration_test.go
Outdated
}, | ||
{ | ||
name: "dual-region bucket", | ||
attrs: &BucketAttrs{Location: "NAM4"}, |
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.
Why is this case repeated?
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.
Typo :)
storage/integration_test.go
Outdated
{ | ||
name: "dual-region bucket", | ||
attrs: &BucketAttrs{Location: "NAM4"}, | ||
expectDirectConnectivity: true, |
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.
I didn't expect NAM4 to return true.
attrs: &BucketAttrs{Location: "us-west1"}, | ||
expectDirectConnectivity: true, | ||
}, | ||
{ |
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.
Maybe have a TODO to add NAM4 with true as well?
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.
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.
Ahh got it. Sounds good.
Raised in: raj-prince/custom-go-client-benchmark#31
Condition didn't check for empty
{}
which failed for multi-region and InterContinental GCE / bucket.Added an additional integration test to check for this case.