From 243c7db4b094fdb25c54d0017712a655da138eef Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Sun, 5 Sep 2021 13:38:27 -0500 Subject: Preserve original ordering --- testcase.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'testcase.go') diff --git a/testcase.go b/testcase.go index 19f1e58..d1db292 100644 --- a/testcase.go +++ b/testcase.go @@ -45,8 +45,17 @@ type TestCase struct { Cname string Config TestCaseConfig + + // Reorder according to original read order after concurrent operation + readIdx int } func (tc TestCase) AdapterConfig() InheritableConfig { return tc.Config.adapters_[*tc.Config.Adapter] } + +type ByReadIdx []TestResult + +func (a ByReadIdx) Len() int { return len(a) } +func (a ByReadIdx) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a ByReadIdx) Less(i, j int) bool { return a[i].Tc.readIdx < a[j].Tc.readIdx } -- cgit v1.2.3