File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ from crawlee ._utils .crypto import crypto_random_object_id
4+
35
46def generate_unique_resource_name (label : str ) -> str :
57 """Generates a unique resource name, which will contain the given label."""
68 name_template = 'python-sdk-tests-{}-generated-{}'
79 template_length = len (name_template .format ('' , '' ))
810 api_name_limit = 63
9- label_length_limit = api_name_limit - template_length
11+ generated_random_id_length = 8
12+ label_length_limit = api_name_limit - template_length - generated_random_id_length
1013
1114 label = label .replace ('_' , '-' )
1215 assert len (label ) <= label_length_limit , f'Max label length is { label_length_limit } , but got { len (label )} '
1316
14- return name_template .format (label , template_length )
17+ return name_template .format (label , crypto_random_object_id ( generated_random_id_length ) )
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ async def main() -> None:
250250 'Accessed with the same client, should be False'
251251 )
252252
253- actor = await make_actor (label = 'rq-multiple- clients-resurrection' , main_func = main )
253+ actor = await make_actor (label = 'rq-clients-resurrection' , main_func = main )
254254 run_result = await run_actor (actor )
255255 assert run_result .status == 'SUCCEEDED'
256256
You can’t perform that action at this time.
0 commit comments