File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,14 @@ public void SetUp()
3030 public void ReadInt64Property ( )
3131 {
3232 double optimisticPerfRatio = GetOptimisticPerfRatio ( this . summary . Reports ) ;
33- Assert . LessOrEqual ( optimisticPerfRatio , 0.68 ) ;
33+ AssertPerformanceIsBetterOrSame ( optimisticPerfRatio , target : 0.66 ) ;
3434 }
3535
3636 [ Test ]
3737 public void WriteInt64Property ( )
3838 {
3939 double optimisticPerfRatio = GetOptimisticPerfRatio ( this . summary . Reports ) ;
40- Assert . LessOrEqual ( optimisticPerfRatio , 0.67 ) ;
40+ AssertPerformanceIsBetterOrSame ( optimisticPerfRatio , target : 0.64 ) ;
4141 }
4242
4343 static double GetOptimisticPerfRatio (
@@ -61,5 +61,14 @@ static double GetOptimisticPerfRatio(
6161 }
6262
6363 public static string DeploymentRoot => Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ;
64+
65+ public static void AssertPerformanceIsBetterOrSame (
66+ double actual , double target ,
67+ double wiggleRoom = 1.1 , [ CallerMemberName ] string testName = null ) {
68+ double threshold = target * wiggleRoom ;
69+ Assert . LessOrEqual ( actual , threshold ,
70+ $ "{ testName } : { actual : F3} > { threshold : F3} (target: { target : F3} )"
71+ + ": perf result is higher than the failure threshold." ) ;
72+ }
6473 }
6574}
You can’t perform that action at this time.
0 commit comments