Skip to content

Commit 2f57c08

Browse files
authored
chore(test): use testing.B.Loop (#13385)
1 parent a66ba3c commit 2f57c08

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- chore(deps): update of quic-go to v0.54.1 and go-libp2p to v0.43.0 ([filecoin-project/lotus#13361](https://github.com/filecoin-project/lotus/pull/13361))
1414
- feat(spcli): add a `deposit-margin-factor` option to `lotus-miner actor new` and `lotus-shed miner create` so the sent deposit still covers the on-chain requirement if it rises between lookup and execution
1515
- feat(cli): lotus evm deploy prints message CID ([filecoin-project/lotus#13378](https://github.com/filecoin-project/lotus/pull/13378))
16+
- chore: update benchmark tests to use testing.B.Loop for improved performance ([filecoin-project/lotus#13385](https://github.com/filecoin-project/lotus/pull/13385))
1617
- fix(eth): properly return vm error in all gas estimation methods ([filecoin-project/lotus#13389](https://github.com/filecoin-project/lotus/pull/13389))
1718
- chore: all actor cmd support --actor ([filecoin-project/lotus#13391](https://github.com/filecoin-project/lotus/pull/13391))
1819

chain/store/store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func BenchmarkGetRandomness(b *testing.B) {
8484

8585
b.ResetTimer()
8686

87-
for i := 0; i < b.N; i++ {
87+
for b.Loop() {
8888
_, err := cg.StateManager().GetRandomnessFromTickets(context.TODO(), crypto.DomainSeparationTag_SealRandomness, 500, nil, last.Key())
8989
if err != nil {
9090
b.Fatal(err)

chain/sync_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ func TestMatchedNoncesRobustID(t *testing.T) {
899899
}
900900

901901
func BenchmarkSyncBasic(b *testing.B) {
902-
for i := 0; i < b.N; i++ {
902+
for b.Loop() {
903903
runSyncBenchLength(b, 100)
904904
}
905905
}

chain/types/blockheader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func BenchmarkBlockHeaderMarshal(b *testing.B) {
129129
b.ReportAllocs()
130130

131131
buf := new(bytes.Buffer)
132-
for i := 0; i < b.N; i++ {
132+
for b.Loop() {
133133
buf.Reset()
134134
if err := bh.MarshalCBOR(buf); err != nil {
135135
b.Fatal(err)

0 commit comments

Comments
 (0)