File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,11 @@ def function_optimization_attempted_error() -> CodeflashError:
35
35
)
36
36
37
37
38
- def baseline_establishment_failed_error () -> CodeflashError :
38
+ def baseline_establishment_failed_error (failure_msg : str ) -> CodeflashError :
39
39
return CodeflashError (
40
- "BASELINE_ESTABLISHMENT_FAILED_ERROR" , "Failed to establish a baseline for the original code."
40
+ "BASELINE_ESTABLISHMENT_FAILED_ERROR" ,
41
+ "Failed to establish a baseline for the original code. {failure_msg}" ,
42
+ ** locals (),
41
43
)
42
44
43
45
Original file line number Diff line number Diff line change @@ -1461,6 +1461,7 @@ def establish_original_code_baseline(
1461
1461
)
1462
1462
)
1463
1463
console .rule ()
1464
+ failure_msg = ""
1464
1465
1465
1466
total_timing = benchmarking_results .total_passed_runtime () # caution: doesn't handle the loop index
1466
1467
functions_to_remove = [
@@ -1469,17 +1470,17 @@ def establish_original_code_baseline(
1469
1470
if (result .test_type == TestType .GENERATED_REGRESSION and not result .did_pass )
1470
1471
]
1471
1472
if total_timing == 0 :
1472
- logger .warning (
1473
- "The overall summed benchmark runtime of the original function is 0, couldn't run tests."
1474
- )
1473
+ failure_msg = "The overall summed benchmark runtime of the original function is 0, couldn't run tests."
1474
+ logger .warning (failure_msg )
1475
1475
console .rule ()
1476
1476
success = False
1477
1477
if not total_timing :
1478
- logger .warning ("Failed to run the tests for the original function, skipping optimization" )
1478
+ failure_msg = "Failed to run the tests for the original function, skipping optimization"
1479
+ logger .warning (failure_msg )
1479
1480
console .rule ()
1480
1481
success = False
1481
1482
if not success :
1482
- return Failure (baseline_establishment_failed_error ())
1483
+ return Failure (baseline_establishment_failed_error (failure_msg ))
1483
1484
1484
1485
loop_count = max ([int (result .loop_index ) for result in benchmarking_results .test_results ])
1485
1486
logger .info (
You can’t perform that action at this time.
0 commit comments