Skip to content

Commit

Permalink
Multiple iterations and batches per worker test fix. (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-myles authored Oct 22, 2024
1 parent 539f173 commit 7631ac8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ require (
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/moby/sys/mount v0.3.4 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/sys/user v0.3.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand All @@ -158,7 +159,7 @@ require (
github.com/onsi/ginkgo/v2 v2.20.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runc v1.1.15 // indirect
github.com/opencontainers/runc v1.2.0 // indirect
github.com/pascaldekloe/name v1.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ github.com/moby/sys/mount v0.3.4 h1:yn5jq4STPztkkzSKpZkLcmjue+bZJ0u2AuQY1iNI1Ww=
github.com/moby/sys/mount v0.3.4/go.mod h1:KcQJMbQdJHPlq5lcYT+/CjatWM4PuxKe+XLSVS4J6Os=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo=
github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -431,8 +433,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
github.com/opencontainers/runc v1.1.15 h1:QMmSU2q1YUg3iOJX11phnaDi2A5/zhx4BR6h+XZ1DMA=
github.com/opencontainers/runc v1.1.15/go.mod h1:E4C2z+7BxR7GHXp0hAY53mek+x49X1LjPNeMTfRGvOA=
github.com/opencontainers/runc v1.2.0 h1:qke7ZVCmJcKrJVY2iHJVC+0kql9uYdkusOPsQOOeBw4=
github.com/opencontainers/runc v1.2.0/go.mod h1:/PXzF0h531HTMsYQnmxXkBD7YaGShm/2zcRB79dksUc=
github.com/pascaldekloe/name v1.0.1 h1:9lnXOHeqeHHnWLbKfH6X98+4+ETVqFqxN09UXSjcMb0=
github.com/pascaldekloe/name v1.0.1/go.mod h1:Z//MfYJnH4jVpQ9wkclwu2I2MkHmXTlT9wR5UZScttM=
github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
Expand Down
19 changes: 10 additions & 9 deletions miner/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,17 @@ func trueOncePerWorkerIteration(tb testing.TB, totalWorkers, totalBatches uint64
}

func slowTelemetry(workers int64) *telemetry {
deadlineMultiplier := stdlibtime.Duration(12)
tel := new(telemetry).mustInit(config{Workers: workers})
tel.collectElapsed(0, stdlibtime.Now().Add(-60*stdlibtime.Second))
tel.collectElapsed(1, stdlibtime.Now().Add(-50*stdlibtime.Second))
tel.collectElapsed(2, stdlibtime.Now().Add(-40*stdlibtime.Second))
tel.collectElapsed(3, stdlibtime.Now().Add(-30*stdlibtime.Second))
tel.collectElapsed(4, stdlibtime.Now().Add(-20*stdlibtime.Second))
tel.collectElapsed(5, stdlibtime.Now().Add(-10*stdlibtime.Second))
tel.collectElapsed(6, stdlibtime.Now().Add(-1*stdlibtime.Second))
tel.collectElapsed(7, stdlibtime.Now().Add(-1*stdlibtime.Second))
tel.collectElapsed(8, stdlibtime.Now().Add(-1*stdlibtime.Second))
tel.collectElapsed(0, stdlibtime.Now().Add(-deadlineMultiplier*60*stdlibtime.Second))
tel.collectElapsed(1, stdlibtime.Now().Add(-deadlineMultiplier*50*stdlibtime.Second))
tel.collectElapsed(2, stdlibtime.Now().Add(-deadlineMultiplier*40*stdlibtime.Second))
tel.collectElapsed(3, stdlibtime.Now().Add(-deadlineMultiplier*30*stdlibtime.Second))
tel.collectElapsed(4, stdlibtime.Now().Add(-deadlineMultiplier*20*stdlibtime.Second))
tel.collectElapsed(5, stdlibtime.Now().Add(-deadlineMultiplier*10*stdlibtime.Second))
tel.collectElapsed(6, stdlibtime.Now().Add(-deadlineMultiplier*1*stdlibtime.Second))
tel.collectElapsed(7, stdlibtime.Now().Add(-deadlineMultiplier*1*stdlibtime.Second))
tel.collectElapsed(8, stdlibtime.Now().Add(-deadlineMultiplier*1*stdlibtime.Second))

return tel
}

0 comments on commit 7631ac8

Please sign in to comment.