Skip to content

Commit

Permalink
testing: remove debug
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Dec 13, 2023
1 parent 4a4a9c9 commit 4f223b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ jobs:
autopilot
bus bus/client
worker worker/client
# - name: Test
# uses: n8maninger/action-golang-test@v1
# with:
# args: "-race;-short"
- name: Test
uses: n8maninger/action-golang-test@v1
with:
args: "-race;-short"
- name: Test Integration
uses: n8maninger/action-golang-test@v1
with:
package: "./internal/testing/..."
args: "-race;-tags=testing;-timeout=2h;-run=^TestUploadDownloadSpending$;-count=200"
# - name: Test Integration - MySQL
# if: matrix.os == 'ubuntu-latest'
# uses: n8maninger/action-golang-test@v1
# env:
# RENTERD_DB_URI: 127.0.0.1:3800
# RENTERD_DB_USER: root
# RENTERD_DB_PASSWORD: test
# with:
# package: "./internal/testing/..."
# args: "-race;-tags=testing;-timeout=30m"
args: "-race;-tags=testing;-timeout=30m"
- name: Test Integration - MySQL
if: matrix.os == 'ubuntu-latest'
uses: n8maninger/action-golang-test@v1
env:
RENTERD_DB_URI: 127.0.0.1:3800
RENTERD_DB_USER: root
RENTERD_DB_PASSWORD: test
with:
package: "./internal/testing/..."
args: "-race;-tags=testing;-timeout=30m"
- name: Build
run: go build -o bin/ ./cmd/renterd
2 changes: 0 additions & 2 deletions autopilot/contractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ func (c *contractor) computeContractSetChanged(ctx context.Context, name string,
reason = "unknown"
}
removedReasons[contract.ID.String()] = reason
fmt.Printf("DEBUG PJ: ap: contract %v removed reason %v\n", contract.ID, reason)
c.logger.Debugf("contract %v was removed from the contract set, size: %v, reason: %v", contract.ID, contractData[contract.ID], reason)
}
}
Expand Down Expand Up @@ -517,7 +516,6 @@ func (c *contractor) computeContractSetChanged(ctx context.Context, name string,
)
hasChanged := len(added)+len(removed) > 0
if hasChanged {
fmt.Printf("DEBUG PJ: ap: num contracts %d added %d removed %d renewed %d\n", len(newSet), len(added), len(removed), len(renewed))
c.ap.RegisterAlert(ctx, newContractSetChangeAlert(name, len(added), len(removed), removedReasons))
}
return hasChanged
Expand Down
11 changes: 0 additions & 11 deletions worker/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,6 @@ func (mgr *uploadManager) newUpload(ctx context.Context, totalShards int, contra
}

func (mgr *uploadManager) refreshUploaders(contracts []api.ContractMetadata, bh uint64) {
var added int
var stopped int
var renewedd int

// build map of renewals
renewals := make(map[types.FileContractID]api.ContractMetadata)
for _, c := range contracts {
Expand All @@ -738,17 +734,13 @@ func (mgr *uploadManager) refreshUploaders(contracts []api.ContractMetadata, bh
for _, uploader := range mgr.uploaders {
// renew uploaders that got renewed
if renewal, renewed := renewals[uploader.ContractID()]; renewed {
fmt.Printf("DEBUG PJ: mgr: renewing %v to %v\n", uploader.ContractID(), renewal.ID)
host := mgr.hm.Host(renewal.HostKey, renewal.ID, renewal.SiamuxAddr)
uploader.Renew(host, renewal, bh)
renewedd++
}

// stop uploaders that expired
if uploader.Expired(bh) {
fmt.Printf("DEBUG PJ: mgr: stopping %v\n", uploader.ContractID())
uploader.Stop()
stopped++
continue
}

Expand All @@ -764,16 +756,13 @@ func (mgr *uploadManager) refreshUploaders(contracts []api.ContractMetadata, bh
// add missing uploaders
for _, c := range contracts {
if _, exists := existing[c.ID]; !exists {
added++
host := mgr.hm.Host(c.HostKey, c.ID, c.SiamuxAddr)
uploader := mgr.newUploader(mgr.os, host, c, bh)
fmt.Printf("DEBUG PJ: mgr: starting %v\n", uploader.ContractID())
refreshed = append(refreshed, uploader)
go uploader.Start(mgr.hm, mgr.rl)
}
}

fmt.Printf("DEBUG PJ: mgr: uploaders refreshed %d -> %d | added %d | stopped %d | renewed %d\n", len(mgr.uploaders), len(refreshed), added, stopped, renewedd)
mgr.uploaders = refreshed
}

Expand Down

0 comments on commit 4f223b7

Please sign in to comment.