File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,7 @@ def get_users_queue_from_processing_time(
452
452
SystemRequest .finished_at >= interval_start ,
453
453
SystemRequest .finished_at < interval_stop ,
454
454
SystemRequest .status != "deleted" ,
455
+ SystemRequest .started_at .is_not (None ),
455
456
)
456
457
where_clause = sa .sql .or_ (interval_clause , SystemRequest .status == "running" )
457
458
Original file line number Diff line number Diff line change @@ -608,7 +608,7 @@ def test_get_request(session_obj: sa.orm.sessionmaker) -> None:
608
608
assert request .request_uid == request_uid
609
609
610
610
611
- def test_get_users_queue_per_cost (session_obj : sa .orm .sessionmaker ) -> None :
611
+ def test_get_users_queue_from_processing_time (session_obj : sa .orm .sessionmaker ) -> None :
612
612
adaptor_properties = mock_config ()
613
613
request_1 = mock_system_request (
614
614
status = "successful" ,
@@ -647,6 +647,13 @@ def test_get_users_queue_per_cost(session_obj: sa.orm.sessionmaker) -> None:
647
647
adaptor_properties_hash = adaptor_properties .hash ,
648
648
user_uid = "user3" ,
649
649
)
650
+ request_7 = mock_system_request (
651
+ status = "failed" ,
652
+ adaptor_properties_hash = adaptor_properties .hash ,
653
+ user_uid = "user3" ,
654
+ started_at = None ,
655
+ finished_at = datetime .datetime .now () - datetime .timedelta (hours = 10 ),
656
+ )
650
657
with session_obj () as session :
651
658
session .add (adaptor_properties )
652
659
session .add (request_1 )
@@ -655,6 +662,7 @@ def test_get_users_queue_per_cost(session_obj: sa.orm.sessionmaker) -> None:
655
662
session .add (request_4 )
656
663
session .add (request_5 )
657
664
session .add (request_6 )
665
+ session .add (request_7 )
658
666
session .commit ()
659
667
with session_obj () as session :
660
668
users_cost = db .get_users_queue_from_processing_time (
You can’t perform that action at this time.
0 commit comments