Skip to content

Commit

Permalink
testing: add more debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Oct 21, 2024
1 parent a79c257 commit ce2e944
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
uses: n8maninger/action-golang-test@v1
with:
package: "./internal/test/e2e/..."
args: "-failfast;-race;-timeout=60m"
args: "-failfast;-race;-timeout=60m;-count=20;run='TestUploadPacking'"
- name: Test Integration - MySQL
if: matrix.os == 'ubuntu-latest'
uses: n8maninger/action-golang-test@v1
Expand All @@ -82,6 +82,6 @@ jobs:
RENTERD_DB_PASSWORD: test
with:
package: "./internal/test/e2e/..."
args: "-failfast;-race;-timeout=60m"
args: "-failfast;-race;-timeout=60m;-count=20;run='TestUploadPacking'"
- name: Build
run: go build -o bin/ ./cmd/renterd
5 changes: 4 additions & 1 deletion stores/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,9 @@ func (s *SQLStore) ObjectMetadata(ctx context.Context, bucket, path string) (obj
func (s *SQLStore) PackedSlabsForUpload(ctx context.Context, lockingDuration time.Duration, minShards, totalShards uint8, set string, limit int) ([]api.PackedSlab, error) {
packed, err := s.slabBufferMgr.SlabsForUpload(ctx, lockingDuration, minShards, totalShards, set, limit)
if len(packed) > 0 {
fmt.Println("DEBUG PJ: bus returning packed slab")
for _, p := range packed {
fmt.Println("DEBUG PJ: BUS returning packed slab", p.BufferID)
}
}
return packed, err
}
Expand All @@ -690,6 +692,7 @@ func (s *SQLStore) PrunableContractRoots(ctx context.Context, fcid types.FileCon
func (s *SQLStore) MarkPackedSlabsUploaded(ctx context.Context, slabs []api.UploadedPackedSlab) error {
// Sanity check input.
for i, ss := range slabs {
fmt.Println("DEBUG PJ: BUS: MarkPackedSlabsUploaded", ss.BufferID)
for _, shard := range ss.Shards {
// Verify that all hosts have a contract.
if len(shard.Contracts) == 0 {
Expand Down
2 changes: 2 additions & 0 deletions stores/slabbuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ func (mgr *SlabBufferManager) Close() error {
}

func (mgr *SlabBufferManager) AddPartialSlab(ctx context.Context, data []byte, minShards, totalShards uint8, contractSet string) ([]object.SlabSlice, int64, error) {
fmt.Println("DEBUG PJ: BUS: add partial slab", len(data))
defer fmt.Println("DEBUG PJ: BUS: done adding partial slab", len(data))
var set int64
err := mgr.db.Transaction(ctx, func(tx sql.DatabaseTx) (err error) {
set, err = tx.ContractSetID(ctx, contractSet)
Expand Down

0 comments on commit ce2e944

Please sign in to comment.