Skip to content

Commit

Permalink
Deflake dataapi server test (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Feb 23, 2024
1 parent 863a778 commit 25dd873
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions disperser/dataapi/metrics_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"math/big"
"sort"
"strconv"
"time"

Expand Down Expand Up @@ -186,6 +187,14 @@ func (s *server) getOperatorNonsigningPercentage(ctx context.Context, intervalSe
}
}

// Sort by descending order of nonsigning rate.
sort.Slice(operators, func(i, j int) bool {
if operators[i].Percentage == operators[j].Percentage {
return operators[i].OperatorId < operators[j].OperatorId
}
return operators[i].Percentage > operators[j].Percentage
})

return &OperatorsNonsigningPercentage{
Meta: Meta{
Size: len(operators),
Expand Down

0 comments on commit 25dd873

Please sign in to comment.