File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -814,7 +814,7 @@ pub enum BenchmarkRequestStatus {
814
814
InProgress ,
815
815
Completed {
816
816
completed_at : DateTime < Utc > ,
817
- duration_ms : u32 ,
817
+ duration : Duration ,
818
818
} ,
819
819
}
820
820
@@ -846,9 +846,9 @@ impl BenchmarkRequestStatus {
846
846
completed_at : completion_date. ok_or_else ( || {
847
847
anyhow ! ( "No completion date for a completed BenchmarkRequestStatus" )
848
848
} ) ?,
849
- duration_ms : duration_ms. ok_or_else ( || {
849
+ duration : Duration :: from_millis ( duration_ms. ok_or_else ( || {
850
850
anyhow ! ( "No completion duration for a completed BenchmarkRequestStatus" )
851
- } ) ? as u32 ,
851
+ } ) ? as u64 ) ,
852
852
} ) ,
853
853
_ => Err ( anyhow ! ( "Unknown BenchmarkRequestStatus `{text}`" ) ) ,
854
854
}
Original file line number Diff line number Diff line change @@ -973,6 +973,9 @@ mod tests {
973
973
974
974
assert_eq ! ( job. request_tag( ) , benchmark_request. tag( ) . unwrap( ) ) ;
975
975
976
+ /* Make the job take some amount of time */
977
+ std:: thread:: sleep ( Duration :: from_millis ( 1000 ) ) ;
978
+
976
979
/* Mark the job as complete */
977
980
db. mark_benchmark_job_as_completed ( job. id ( ) , BenchmarkJobConclusion :: Success )
978
981
. await
@@ -994,10 +997,10 @@ mod tests {
994
997
req. status( ) ,
995
998
BenchmarkRequestStatus :: Completed { .. }
996
999
) ) ;
997
- let BenchmarkRequestStatus :: Completed { duration_ms , .. } = req. status ( ) else {
1000
+ let BenchmarkRequestStatus :: Completed { duration , .. } = req. status ( ) else {
998
1001
unreachable ! ( ) ;
999
1002
} ;
1000
- assert ! ( duration_ms >= 1 ) ;
1003
+ assert ! ( duration >= Duration :: from_millis ( 1000 ) ) ;
1001
1004
1002
1005
let completed_index = db. load_benchmark_request_index ( ) . await . unwrap ( ) ;
1003
1006
assert ! ( completed_index. contains_tag( "sha-1" ) ) ;
You can’t perform that action at this time.
0 commit comments