sched: Address review

This commit is contained in:
Łukasz Magiera 2022-11-29 11:45:31 +01:00
parent 5a458a60c2
commit 1597e85906
2 changed files with 5 additions and 0 deletions

View File

@ -67,6 +67,7 @@ func (a *AssignerCommon) TrySched(sh *Scheduler) {
partDone := metrics.Timer(sh.mctx, metrics.SchedAssignerCandidatesDuration)
defer func() {
// call latest value of partDone in case we error out somewhere
partDone()
}()

View File

@ -589,12 +589,16 @@ func TestSched(t *testing.T) {
type slowishSelector bool
func (s slowishSelector) Ok(ctx context.Context, task sealtasks.TaskType, spt abi.RegisteredSealProof, a SchedWorker) (bool, bool, error) {
// note: we don't care about output here, just the time those calls take
// (selector Ok/Cmp is called in the scheduler)
_, _ = a.Paths(ctx)
_, _ = a.TaskTypes(ctx)
return bool(s), false, nil
}
func (s slowishSelector) Cmp(ctx context.Context, task sealtasks.TaskType, a, b SchedWorker) (bool, error) {
// note: we don't care about output here, just the time those calls take
// (selector Ok/Cmp is called in the scheduler)
_, _ = a.Paths(ctx)
return true, nil
}