From 4f223b73ff0f76368b195e15b449ee05518df276 Mon Sep 17 00:00:00 2001 From: PJ Date: Wed, 13 Dec 2023 14:50:12 +0100 Subject: [PATCH] testing: remove debug --- .github/workflows/test.yml | 30 +++++++++++++++--------------- autopilot/contractor.go | 2 -- worker/upload.go | 11 ----------- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b49d844f..ce8ea5c4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/autopilot/contractor.go b/autopilot/contractor.go index 841aa06f3..eb2b66763 100644 --- a/autopilot/contractor.go +++ b/autopilot/contractor.go @@ -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) } } @@ -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 diff --git a/worker/upload.go b/worker/upload.go index 5586e54e9..d54e7f395 100644 --- a/worker/upload.go +++ b/worker/upload.go @@ -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 { @@ -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 } @@ -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 }