@@ -1058,7 +1058,9 @@ async def test_schedule_backfill(
1058
1058
)
1059
1059
],
1060
1060
)
1061
- assert 2 == (await handle .describe ()).info .num_actions
1061
+ # The number of items backfilled on a schedule boundary changed in 1.24, so
1062
+ # we check for either
1063
+ assert (await handle .describe ()).info .num_actions in [2 , 3 ]
1062
1064
1063
1065
# Add two more backfills and and -2m will be deduped
1064
1066
await handle .backfill (
@@ -1073,7 +1075,9 @@ async def test_schedule_backfill(
1073
1075
overlap = ScheduleOverlapPolicy .ALLOW_ALL ,
1074
1076
),
1075
1077
)
1076
- assert 6 == (await handle .describe ()).info .num_actions
1078
+ # The number of items backfilled on a schedule boundary changed in 1.24, so
1079
+ # we check for either
1080
+ assert (await handle .describe ()).info .num_actions in [6 , 8 ]
1077
1081
1078
1082
await handle .delete ()
1079
1083
await assert_no_schedules (client )
@@ -1155,19 +1159,17 @@ def update_schedule_typed_attrs(
1155
1159
input .description .typed_search_attributes [text_attr_key ]
1156
1160
== "some-schedule-attr1"
1157
1161
)
1162
+ # This assertion has changed since server 1.24. Now, even untyped search
1163
+ # attributes are given a type server side
1158
1164
assert (
1159
1165
input .description .schedule .action .typed_search_attributes
1160
- and len (input .description .schedule .action .typed_search_attributes ) == 1
1166
+ and len (input .description .schedule .action .typed_search_attributes ) == 2
1161
1167
and input .description .schedule .action .typed_search_attributes [text_attr_key ]
1162
1168
== "some-workflow-attr1"
1163
- )
1164
- assert (
1165
- input .description .schedule .action .untyped_search_attributes
1166
- and len (input .description .schedule .action .untyped_search_attributes ) == 1
1167
- and input .description .schedule .action .untyped_search_attributes [
1168
- untyped_keyword_key .name
1169
+ and input .description .schedule .action .typed_search_attributes [
1170
+ untyped_keyword_key
1169
1171
]
1170
- == [ "some-untyped-attr1" ]
1172
+ == "some-untyped-attr1"
1171
1173
)
1172
1174
1173
1175
# Update the workflow search attribute with a new typed value but does
@@ -1189,41 +1191,16 @@ def update_schedule_typed_attrs(
1189
1191
# Check that it changed
1190
1192
desc = await handle .describe ()
1191
1193
assert isinstance (desc .schedule .action , ScheduleActionStartWorkflow )
1194
+ # This assertion has changed since server 1.24. Now, even untyped search
1195
+ # attributes are given a type server side
1192
1196
assert (
1193
1197
desc .schedule .action .typed_search_attributes
1194
- and len (desc .schedule .action .typed_search_attributes ) == 1
1195
- and desc .schedule .action .typed_search_attributes [text_attr_key ]
1196
- == "some-workflow-attr2"
1197
- )
1198
- assert (
1199
- desc .schedule .action .untyped_search_attributes
1200
- and len (desc .schedule .action .untyped_search_attributes ) == 1
1201
- and desc .schedule .action .untyped_search_attributes [untyped_keyword_key .name ]
1202
- == ["some-untyped-attr1" ]
1203
- )
1204
-
1205
- # Normal update with no typed attr change but remove untyped
1206
- def update_schedule_remove_untyped (
1207
- input : ScheduleUpdateInput ,
1208
- ) -> Optional [ScheduleUpdate ]:
1209
- assert isinstance (
1210
- input .description .schedule .action , ScheduleActionStartWorkflow
1211
- )
1212
- input .description .schedule .action .untyped_search_attributes = {}
1213
- return ScheduleUpdate (input .description .schedule )
1214
-
1215
- await handle .update (update_schedule_remove_untyped )
1216
-
1217
- # Check that typed did not change but untyped did
1218
- desc = await handle .describe ()
1219
- assert isinstance (desc .schedule .action , ScheduleActionStartWorkflow )
1220
- assert (
1221
- desc .schedule .action .typed_search_attributes
1222
- and len (desc .schedule .action .typed_search_attributes ) == 1
1198
+ and len (desc .schedule .action .typed_search_attributes ) == 2
1223
1199
and desc .schedule .action .typed_search_attributes [text_attr_key ]
1224
1200
== "some-workflow-attr2"
1201
+ and desc .schedule .action .typed_search_attributes [untyped_keyword_key ]
1202
+ == "some-untyped-attr1"
1225
1203
)
1226
- assert not desc .schedule .action .untyped_search_attributes
1227
1204
1228
1205
1229
1206
async def assert_no_schedules (client : Client ) -> None :
0 commit comments