Skip to content

fix(storage): correct direct connectivity check#11152

Merged
frankyn merged 8 commits intomainfrom
fix-dp-check
Nov 20, 2024
Merged

fix(storage): correct direct connectivity check#11152
frankyn merged 8 commits intomainfrom
fix-dp-check

Conversation

@frankyn
Copy link
Copy Markdown
Contributor

@frankyn frankyn commented Nov 19, 2024

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.

@frankyn frankyn requested review from a team November 19, 2024 19:16
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Nov 19, 2024
Comment thread storage/integration_test.go Outdated
err = CheckDirectConnectivitySupported(ctx, newMRBucketName)
if err == nil {
t.Fatalf("CheckDirectConnectivitySupported: error expected, got nil")
}
Copy link
Copy Markdown
Contributor

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:

  1. single region, same region as VM (expect success)
  2. 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.

Copy link
Copy Markdown
Contributor Author

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

Comment thread 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" {
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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

Comment thread storage/integration_test.go Outdated
}
gceRegion := v.AsString()
var otherRegion string
for _, r := range []string{"us-west1", "us-east1", "us-central1"} {
Copy link
Copy Markdown
Contributor

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?

Comment thread storage/integration_test.go Outdated
},
{
name: "dual-region bucket",
attrs: &BucketAttrs{Location: "NAM4"},
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo :)

Comment thread storage/integration_test.go Outdated
{
name: "dual-region bucket",
attrs: &BucketAttrs{Location: "NAM4"},
expectDirectConnectivity: true,
Copy link
Copy Markdown
Contributor Author

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.

@frankyn
Copy link
Copy Markdown
Contributor Author

frankyn commented Nov 20, 2024

Kokoro failed on
image
Flake ignoring.

attrs: &BucketAttrs{Location: "us-west1"},
expectDirectConnectivity: true,
},
{
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAM4 wouldn't work in this case since it's a pairing of us-central1 and us-east1.
image

Need to create a new pairing with customPlacementConfig; I'll add a todo for customPlacement though.

Copy link
Copy Markdown
Contributor

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.

@frankyn frankyn enabled auto-merge (squash) November 20, 2024 05:15
@frankyn frankyn merged commit a75c8b0 into main Nov 20, 2024
@frankyn frankyn deleted the fix-dp-check branch November 20, 2024 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants