File tree 2 files changed +18
-10
lines changed
bindata/assets/deployments
pkg/console/subresource/deployment 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 45
45
periodSeconds : 10
46
46
successThreshold : 1
47
47
failureThreshold : 3
48
+ initialDelaySeconds : 5
48
49
name : download-server
49
50
securityContext :
50
51
readOnlyRootFilesystem : false
63
64
periodSeconds : 10
64
65
successThreshold : 1
65
66
failureThreshold : 3
67
+ initialDelaySeconds : 5
66
68
ports :
67
69
- name : http
68
70
containerPort : 8080
78
80
79
81
signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(0))
80
82
83
+ ready = threading.Event()
84
+
81
85
def write_index(path, message):
82
86
with open(path, 'wb') as f:
83
87
f.write('\n'.join([
@@ -112,7 +116,8 @@ spec:
112
116
# https://stackoverflow.com/questions/46210672/
113
117
httpd.socket = self.socket
114
118
httpd.server_bind = self.server_close = lambda self: None
115
-
119
+ if self.i == 0:
120
+ ready.set()
116
121
httpd.serve_forever()
117
122
118
123
temp_dir = tempfile.mkdtemp()
@@ -186,12 +191,13 @@ spec:
186
191
addr = ('', 8080)
187
192
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
188
193
else:
189
- raise
194
+ raise
190
195
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
191
196
sock.bind(addr)
192
197
sock.listen(5)
193
198
194
199
[Thread(i, socket=sock) for i in range(100)]
200
+ ready.wait()
195
201
time.sleep(9e9)
196
202
EOF
197
203
exec python3 /tmp/serve.py
Original file line number Diff line number Diff line change @@ -1529,10 +1529,11 @@ func TestDefaultDownloadsDeployment(t *testing.T) {
1529
1529
Scheme : corev1 .URIScheme ("HTTP" ),
1530
1530
},
1531
1531
},
1532
- TimeoutSeconds : 1 ,
1533
- PeriodSeconds : 10 ,
1534
- SuccessThreshold : 1 ,
1535
- FailureThreshold : 3 ,
1532
+ TimeoutSeconds : 1 ,
1533
+ PeriodSeconds : 10 ,
1534
+ SuccessThreshold : 1 ,
1535
+ FailureThreshold : 3 ,
1536
+ InitialDelaySeconds : 5 ,
1536
1537
},
1537
1538
LivenessProbe : & corev1.Probe {
1538
1539
ProbeHandler : corev1.ProbeHandler {
@@ -1542,10 +1543,11 @@ func TestDefaultDownloadsDeployment(t *testing.T) {
1542
1543
Scheme : corev1 .URIScheme ("HTTP" ),
1543
1544
},
1544
1545
},
1545
- TimeoutSeconds : 1 ,
1546
- PeriodSeconds : 10 ,
1547
- SuccessThreshold : 1 ,
1548
- FailureThreshold : 3 ,
1546
+ TimeoutSeconds : 1 ,
1547
+ PeriodSeconds : 10 ,
1548
+ SuccessThreshold : 1 ,
1549
+ FailureThreshold : 3 ,
1550
+ InitialDelaySeconds : 5 ,
1549
1551
},
1550
1552
Command : []string {"/bin/sh" },
1551
1553
Resources : corev1.ResourceRequirements {
You can’t perform that action at this time.
0 commit comments