From c6c82bb4aec63400b5d73e51ae4d6c5eb7dc529f Mon Sep 17 00:00:00 2001
From: Manuel Kieweg <manuel.kieweg@h-da.de>
Date: Tue, 27 Jul 2021 12:48:17 +0100
Subject: [PATCH] change benchmark order

---
 store/storeBenchmark_test.go | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/store/storeBenchmark_test.go b/store/storeBenchmark_test.go
index ff9f792a0..c96599579 100644
--- a/store/storeBenchmark_test.go
+++ b/store/storeBenchmark_test.go
@@ -115,7 +115,7 @@ func BenchmarkAddGet(b *testing.B) {
 	}
 }
 
-func BenchmarkGetParallel(b *testing.B) {
+func BenchmarkAddParallel(b *testing.B) {
 	if testing.Short() {
 		b.Skip("skipping parallel tests in short mode")
 	}
@@ -166,14 +166,17 @@ func BenchmarkGetParallel(b *testing.B) {
 			b.SetParallelism(bm.iterations)
 			b.RunParallel(func(pb *testing.PB) {
 				for pb.Next() {
-					bm.s.Get(uuid.Nil)
+					b.StopTimer()
+					item := &testItem{id: uuid.New()}
+					b.StartTimer()
+					bm.s.Add(item)
 				}
 			})
 		})
 	}
 }
 
-func BenchmarkAddParallel(b *testing.B) {
+func BenchmarkGetParallel(b *testing.B) {
 	if testing.Short() {
 		b.Skip("skipping parallel tests in short mode")
 	}
@@ -224,10 +227,7 @@ func BenchmarkAddParallel(b *testing.B) {
 			b.SetParallelism(bm.iterations)
 			b.RunParallel(func(pb *testing.PB) {
 				for pb.Next() {
-					b.StopTimer()
-					item := &testItem{id: uuid.New()}
-					b.StartTimer()
-					bm.s.Add(item)
+					bm.s.Get(uuid.Nil)
 				}
 			})
 		})
-- 
GitLab