11
11
from ...src .multithreading import run_encrypt_and_decrypt_with_keyring_for_duration_seconds
12
12
from ...src .multithreading .raw_aes_keyring import create_keyring
13
13
14
- import time
15
-
16
14
pytestmark = [pytest .mark .examples ]
17
15
18
16
19
- def test_encrypt_and_decrypt_with_keyring_multithreaded_helper (n_threads = 16 , duration = 60 ):
17
+ def encrypt_and_decrypt_with_keyring_multithreaded_helper (n_threads = 64 , duration = 60 ):
20
18
"""Helper function for multi-threaded encrypt and decrypt using a keyring for fixed n_threads and duration."""
21
- print (n_threads , duration )
22
- start_time = time .time ()
23
- print ('start_time' , start_time )
24
19
keyring = create_keyring ()
25
20
plaintext_data = b"Hello World"
26
21
client = aws_encryption_sdk .EncryptionSDKClient (
@@ -36,15 +31,10 @@ def test_encrypt_and_decrypt_with_keyring_multithreaded_helper(n_threads=16, dur
36
31
37
32
for future in as_completed (thread_futures ):
38
33
future .result ()
39
- end_time = time .time ()
40
- print ('end_time' , end_time )
41
- print ('duration' , end_time - start_time )
42
-
43
-
44
- # def test_encrypt_and_decrypt_with_keyring_multithreaded(n_threads_list: list = [4, 16, 64], duration_list: list = [2, 10, 60]):
45
- # """Test function for multi-threaded encrypt and decrypt using a keyring for different n_threads and duration."""
46
- # print('hello', n_threads_list, duration_list)
47
- # for n in n_threads_list:
48
- # for d in duration_list:
49
- # print(n, d, time.time())
50
- # encrypt_and_decrypt_with_keyring_helper(n_threads=n, duration=d)
34
+
35
+
36
+ def test_encrypt_and_decrypt_with_keyring_multithreaded (n_threads_list : list = [1 , 4 , 16 , 64 ], duration_list : list = [2 , 10 , 60 ]):
37
+ """Test function for multi-threaded encrypt and decrypt using a keyring for different n_threads and duration."""
38
+ for n in n_threads_list :
39
+ for d in duration_list :
40
+ encrypt_and_decrypt_with_keyring_multithreaded_helper (n_threads = n , duration = d )
0 commit comments