diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2f050931..227e3c5b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,34 +56,34 @@ jobs: host port: 3800 mysql version: "8" mysql root password: test - - name: Test Stores - uses: n8maninger/action-golang-test@v1 - with: - args: "-race;-short;-tags=netgo" - - name: Test Stores - 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: "./stores" - args: "-race;-short;-tags=netgo" + # - name: Test Stores + # uses: n8maninger/action-golang-test@v1 + # with: + # args: "-race;-short;-tags=netgo" + # - name: Test Stores - 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: "./stores" + # args: "-race;-short;-tags=netgo" - name: Test Integration uses: n8maninger/action-golang-test@v1 with: package: "./internal/test/e2e/..." - args: "-failfast;-race;-timeout=60m;-tags=netgo" - - 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/test/e2e/..." - args: "-failfast;-race;-timeout=60m;-tags=netgo" + args: "-failfast;-race;-timeout=60m;-tags=netgo;-count=50;-run=^TestUploadDownloadExtended$" + # - 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/test/e2e/..." + # args: "-failfast;-race;-timeout=60m;-tags=netgo" - name: Build run: go build -o bin/ -tags='netgo timetzdata' ./cmd/renterd diff --git a/internal/test/e2e/cluster.go b/internal/test/e2e/cluster.go index 3868c2a87..b174a2fce 100644 --- a/internal/test/e2e/cluster.go +++ b/internal/test/e2e/cluster.go @@ -667,6 +667,11 @@ func announceHosts(hosts []*Host) error { // MineToRenewWindow is a helper which mines enough blocks for the autopilot to // reach its renew window. func (c *TestCluster) MineToRenewWindow() { + start := time.Now() + defer func() { + fmt.Printf("DEBUG %v | CLUSTER: MineToRenewWindow took %v\n", time.Now().Format(time.TimeOnly), time.Since(start)) + }() + c.tt.Helper() cs, err := c.Bus.ConsensusState(context.Background()) c.tt.OK(err) @@ -692,6 +697,11 @@ func (c *TestCluster) MineBlocks(n uint64) { } func (c *TestCluster) sync() { + start := time.Now() + defer func() { + fmt.Printf("DEBUG %v | CLUSTER: sync took %v\n", time.Now().Format(time.TimeOnly), time.Since(start)) + }() + tip := c.cm.Tip() c.tt.Retry(3000, time.Millisecond, func() error { cs, err := c.Bus.ConsensusState(context.Background()) diff --git a/worker/downloader.go b/worker/downloader.go index 9720237a1..ab07a0d76 100644 --- a/worker/downloader.go +++ b/worker/downloader.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "errors" + "fmt" "sync" "sync/atomic" "time" @@ -127,6 +128,15 @@ func (d *downloader) estimate() float64 { } func (d *downloader) execute(req *sectorDownloadReq) (err error) { + start := time.Now() + defer func() { + if err == nil { + fmt.Printf("DEBUG %v | HOST: read sector took %v\n", time.Now().Format(time.TimeOnly), time.Since(start)) + } else { + fmt.Printf("DEBUG %v | HOST: read sector took %v, failed with %v\n", time.Now().Format(time.TimeOnly), time.Since(start), err) + } + }() + // download the sector buf := bytes.NewBuffer(make([]byte, 0, req.length)) err = d.host.DownloadSector(req.ctx, buf, req.root, req.offset, req.length, req.overpay) diff --git a/worker/uploader.go b/worker/uploader.go index 410760b1a..facb8fbf5 100644 --- a/worker/uploader.go +++ b/worker/uploader.go @@ -249,6 +249,15 @@ func (u *uploader) estimate() float64 { // execute executes the sector upload request, if the upload was successful it // returns the time it took to upload the sector to the host func (u *uploader) execute(req *sectorUploadReq) (_ time.Duration, err error) { + start := time.Now() + defer func() { + if err == nil { + fmt.Printf("DEBUG %v | HOST: write sector took %v\n", time.Now().Format(time.TimeOnly), time.Since(start)) + } else { + fmt.Printf("DEBUG %v | HOST: write sector took %v, failed with %v\n", time.Now().Format(time.TimeOnly), time.Since(start), err) + } + }() + // grab fields u.mu.Lock() host := u.host @@ -298,7 +307,7 @@ func (u *uploader) execute(req *sectorUploadReq) (_ time.Duration, err error) { } // upload the sector - start := time.Now() + start = time.Now() err = host.UploadSector(ctx, req.sector.root, req.sector.sectorData(), rev) if err != nil { return 0, fmt.Errorf("failed to upload sector to contract %v; %w", fcid, err)