@@ -2,7 +2,8 @@ use std::time::Duration;
22use temporal_client:: { Priority , WorkflowClientTrait , WorkflowOptions } ;
33use temporal_sdk:: { ActContext , ActivityOptions , ChildWorkflowOptions , WfContext } ;
44use temporal_sdk_core_protos:: {
5- coresdk:: AsJsonPayloadExt , temporal:: api:: history:: v1:: history_event:: Attributes ,
5+ coresdk:: AsJsonPayloadExt ,
6+ temporal:: api:: { common, history:: v1:: history_event:: Attributes } ,
67} ;
78use temporal_sdk_core_test_utils:: CoreWfStarter ;
89
@@ -34,16 +35,23 @@ async fn priority_values_sent_to_server() {
3435 input : "hello" . as_json_payload ( ) . unwrap ( ) ,
3536 start_to_close_timeout : Some ( Duration :: from_secs ( 5 ) ) ,
3637 priority : Some ( Priority { priority_key : 5 } ) ,
38+ // Currently no priority info attached to eagerly run activities
39+ do_not_eagerly_execute : true ,
3740 ..Default :: default ( )
3841 } ) ;
3942 started. result ( ) . await ;
40- activity. await ;
43+ activity. await . unwrap_ok_payload ( ) ;
4144 Ok ( ( ) . into ( ) )
4245 } ) ;
43- worker. register_wf ( child_type. to_owned ( ) , |_ctx : WfContext | async move {
46+ worker. register_wf ( child_type. to_owned ( ) , |ctx : WfContext | async move {
47+ assert_eq ! (
48+ ctx. workflow_initial_info( ) . priority,
49+ Some ( common:: v1:: Priority { priority_key: 4 } )
50+ ) ;
4451 Ok ( ( ) . into ( ) )
4552 } ) ;
46- worker. register_activity ( "echo" , |_ctx : ActContext , echo_me : String | async move {
53+ worker. register_activity ( "echo" , |ctx : ActContext , echo_me : String | async move {
54+ assert_eq ! ( ctx. get_info( ) . priority, Priority { priority_key: 5 } ) ;
4755 Ok ( echo_me)
4856 } ) ;
4957
0 commit comments