Skip to content

Commit 2b2cc30

Browse files
committed
Properly update generate_unique_resource_name
1 parent efd9e53 commit 2b2cc30

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/integration/_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
from __future__ import annotations
22

3+
from crawlee._utils.crypto import crypto_random_object_id
4+
35

46
def 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))

tests/integration/test_actor_request_queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)