File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
ydb/tests/functional/encryption Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,16 @@ def callee(s):
58
58
logger .exception ("Error executing transaction" )
59
59
60
60
61
- def simple_write (pool ):
62
- for i in range (10000 ):
63
- simple_write_data (pool , random .randint (0 , (1 << 64 ) - 1 ))
61
+ class Workload :
62
+ def __init__ (self ):
63
+ self ._stopped = False
64
+
65
+ def simple_write (self , pool ):
66
+ while not self ._stopped :
67
+ simple_write_data (pool , random .randint (0 , (1 << 64 ) - 1 ))
68
+
69
+ def stop (self ):
70
+ self ._stopped = True
64
71
65
72
66
73
class TestEncryption (object ):
@@ -112,10 +119,14 @@ def test_simple_encryption(self):
112
119
for pool in pools :
113
120
create_sample_table (pool )
114
121
122
+ workloads = []
123
+
115
124
for pool in pools :
125
+ workload = Workload ()
126
+ workloads .append (workload )
116
127
threads .append (
117
128
threading .Thread (
118
- target = lambda : simple_write (pool ),
129
+ target = lambda : workload . simple_write (pool ),
119
130
)
120
131
)
121
132
@@ -138,6 +149,9 @@ def test_simple_encryption(self):
138
149
time .sleep (1 )
139
150
slot .start ()
140
151
152
+ for workload in workloads :
153
+ workload .stop ()
154
+
141
155
for thread in threads :
142
156
thread .join ()
143
157
You can’t perform that action at this time.
0 commit comments