Skip to content

Commit

Permalink
Merge branch 'main' into client_side_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul2393 authored Sep 25, 2024
2 parents 8d9db29 + 36248ca commit a988837
Show file tree
Hide file tree
Showing 10 changed files with 832 additions and 39 deletions.
15 changes: 10 additions & 5 deletions bigquery/dataset_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,19 @@ func TestIntegration_DatasetUpdateDefaultExpirationAndMaxTimeTravel(t *testing.T
t.Skip("Integration tests skipped")
}
ctx := context.Background()
_, err := dataset.Metadata(ctx)
ds := client.Dataset(datasetIDs.New())
err := ds.Create(ctx, &DatasetMetadata{
Location: "US",
})
if err != nil {
t.Fatal(err)
t.Fatalf("Create: %v", err)
}
defer ds.Delete(ctx)

wantExpiration := time.Hour
wantTimeTravel := 48 * time.Hour
// Set the default expiration time.
md, err := dataset.Update(ctx, DatasetMetadataToUpdate{
md, err := ds.Update(ctx, DatasetMetadataToUpdate{
DefaultTableExpiration: wantExpiration,
MaxTimeTravel: wantTimeTravel,
}, "")
Expand All @@ -185,15 +190,15 @@ func TestIntegration_DatasetUpdateDefaultExpirationAndMaxTimeTravel(t *testing.T
t.Fatalf("MaxTimeTravelHours want %s got %s", wantTimeTravel, md.MaxTimeTravel)
}
// Omitting DefaultTableExpiration doesn't change it.
md, err = dataset.Update(ctx, DatasetMetadataToUpdate{Name: "xyz"}, "")
md, err = ds.Update(ctx, DatasetMetadataToUpdate{Name: "xyz"}, "")
if err != nil {
t.Fatal(err)
}
if md.DefaultTableExpiration != time.Hour {
t.Fatalf("got %s, want 1h", md.DefaultTableExpiration)
}
// Setting it to 0 deletes it (which looks like a 0 duration).
md, err = dataset.Update(ctx, DatasetMetadataToUpdate{DefaultTableExpiration: time.Duration(0)}, "")
md, err = ds.Update(ctx, DatasetMetadataToUpdate{DefaultTableExpiration: time.Duration(0)}, "")
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions spanner/pdml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"bytes"
"context"
"errors"
"io/ioutil"
"io"
"log"
"os"
"testing"
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestPartitionedUpdate_WithDeadline(t *testing.T) {
// The following update will cause a 'Failed to delete session' warning to
// be logged. This is expected. To avoid spamming the log, we temporarily
// set the output to be discarded.
logger.SetOutput(ioutil.Discard)
logger.SetOutput(io.Discard)
_, err := client.PartitionedUpdate(ctx, stmt)
logger.SetOutput(os.Stderr)
if err == nil {
Expand Down
3 changes: 1 addition & 2 deletions storage/dataflux/fast_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ type ListerInput struct {
BatchSize int

// Query is the query to filter objects for listing. Default value is nil. Optional.
//Use ProjectionNoACL For faster listing. ACL is expensive and this results in fewer objects
// to be returned from GCS in each API call.
// Use ProjectionNoACL for faster listing. Including ACLs increases latency while fetching objects.
Query storage.Query

// SkipDirectoryObjects is to indicate whether to list directory objects. Default value is false. Optional.
Expand Down
1 change: 0 additions & 1 deletion storage/dataflux/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ var (

func TestMain(m *testing.M) {
flag.Parse()
fmt.Println("creating bucket")
if err := httpTestBucket.Create(testPrefix); err != nil {
log.Fatalf("test bucket creation failed: %v", err)
}
Expand Down
Loading

0 comments on commit a988837

Please sign in to comment.