Skip to content

Commit

Permalink
Flaky blobs caps systemtest
Browse files Browse the repository at this point in the history
Testing using debug logs ahows the extra paging works:

     2024-08-08T12:50:50.028Z    DEBUG    azblob/list.go:19    Count
     2024-08-08T12:50:50.032Z    DEBUG    azblob/list.go:31    Count 2 (0xc00056f840
     2024-08-08T12:50:50.032Z    DEBUG    azblob/list.go:36    Count 2

AB#5311
  • Loading branch information
eccles committed Aug 8, 2024
1 parent 7d74b38 commit db0b12a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions azblob/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,27 @@ import (

azStorageBlob "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"

"github.com/datatrails/go-datatrails-common/logger"
"github.com/datatrails/go-datatrails-common/tracing"
)

// Count counts the number of blobs filtered by the given tags filter
func (azp *Storer) Count(ctx context.Context, tagsFilter string, opts ...Option) (int64, error) {

logger.Sugar.Debugf("Count")

r, err := azp.FilteredList(ctx, tagsFilter, opts...)
if err != nil {
return 0, err
}

return int64(len(r.Items)), nil
var count int64
var m string
opts = append(opts, WithListMarker(&m))

for {
r, err := azp.FilteredList(ctx, tagsFilter, opts...)
if err != nil {
return 0, err
}
count += int64(len(r.Items))
if r.Marker == nil || *r.Marker == "" {
break
}
}
return count, nil
}

type FilterResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion grpcclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (g *Client) Open() error {
var conn *grpc.ClientConn

g.log.Debugf("Open %s client at %v", g.name, g.address)
conn, err = grpc.Dial(g.address, g.options...)
conn, err = grpc.Dial(g.address, g.options...) //nolint:staticcheck // See #9784
if err != nil {
return err
}
Expand Down

0 comments on commit db0b12a

Please sign in to comment.