This commit is contained in:
Łukasz Magiera 2022-03-18 23:18:52 +01:00
parent 5365ccfdb1
commit cca69a6c16
4 changed files with 11 additions and 10 deletions

Binary file not shown.

View File

@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"math"
corebig "math/big"
"os"
@ -36,6 +35,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/builtin/reward"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/journal/alerting"
)

View File

@ -4617,6 +4617,7 @@ Response:
}
}
},
"Tasks": null,
"Enabled": true,
"MemUsedMin": 0,
"MemUsedMax": 0,

View File

@ -513,7 +513,7 @@ func TestRestartWorker(t *testing.T) {
//stm: @WORKER_STATS_001
for {
if len(m.WorkerStats()) == 0 {
if len(m.WorkerStats(ctx)) == 0 {
break
}
@ -576,13 +576,13 @@ func TestReenableWorker(t *testing.T) {
//stm: @WORKER_STATS_001
for i := 0; i < 100; i++ {
if !m.WorkerStats()[w.session].Enabled {
if !m.WorkerStats(ctx)[w.session].Enabled {
break
}
time.Sleep(time.Millisecond * 3)
}
require.False(t, m.WorkerStats()[w.session].Enabled)
require.False(t, m.WorkerStats(ctx)[w.session].Enabled)
i, _ = m.sched.Info(ctx)
require.Len(t, i.(SchedDiagInfo).OpenWindows, 0)
@ -591,13 +591,13 @@ func TestReenableWorker(t *testing.T) {
atomic.StoreInt64(&w.testDisable, 0)
for i := 0; i < 100; i++ {
if m.WorkerStats()[w.session].Enabled {
if m.WorkerStats(ctx)[w.session].Enabled {
break
}
time.Sleep(time.Millisecond * 3)
}
require.True(t, m.WorkerStats()[w.session].Enabled)
require.True(t, m.WorkerStats(ctx)[w.session].Enabled)
for i := 0; i < 100; i++ {
info, _ := m.sched.Info(ctx)
@ -653,7 +653,7 @@ func TestResUse(t *testing.T) {
l:
for {
st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
if w.MemUsedMax > 0 {
@ -663,7 +663,7 @@ l:
}
}
st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
require.Equal(t, storiface.ResourceTable[sealtasks.TTAddPiece][abi.RegisteredSealProof_StackedDrg2KiBV1].MaxMemory, w.MemUsedMax)
@ -715,7 +715,7 @@ func TestResOverride(t *testing.T) {
l:
for {
st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
if w.MemUsedMax > 0 {
@ -725,7 +725,7 @@ l:
}
}
st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
require.Equal(t, uint64(99999), w.MemUsedMax)