From 39f608aa874371755d1d36dcca396482be3dfef1 Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Thu, 13 Jul 2023 13:29:46 +0200 Subject: [PATCH] indexer: remove failing BenchmarkNewProcess it's failing with: bench_test.go:157: error: got non-nil error got: e"transaction not found" stack: /home/runner/work/vocdoni-node/vocdoni-node/vochain/indexer/bench_test.go:157 qt.Assert(b, err, qt.IsNil) --- vochain/indexer/bench_test.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/vochain/indexer/bench_test.go b/vochain/indexer/bench_test.go index 4303b5594..ac5519316 100644 --- a/vochain/indexer/bench_test.go +++ b/vochain/indexer/bench_test.go @@ -160,34 +160,3 @@ func BenchmarkFetchTx(b *testing.B) { numTxs, (i+1)*numTxs, time.Since(startTime)) } } - -func BenchmarkNewProcess(b *testing.B) { - app := vochain.TestBaseApplication(b) - - idx := newTestIndexer(b, app, true) - _ = idx // used via the callbacks; we want to benchmark it too - startTime := time.Now() - numProcesses := b.N - entityID := util.RandomBytes(20) - - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < numProcesses; i++ { - pid := util.RandomBytes(32) - if err := app.State.AddProcess(&models.Process{ - ProcessId: pid, - // EntityId: util.RandomBytes(20), - EntityId: entityID, - EnvelopeType: &models.EnvelopeType{EncryptedVotes: false}, - Status: models.ProcessStatus_READY, - BlockCount: 100000000, - VoteOptions: &models.ProcessVoteOptions{MaxCount: 3, MaxValue: 1}, - Mode: &models.ProcessMode{AutoStart: true}, - }); err != nil { - b.Fatal(err) - } - } - app.AdvanceTestBlock() - log.Infof("indexed %d new processes, took %s", - numProcesses, time.Since(startTime)) -}