Skip to content

Commit fe69430

Browse files
Merge pull request #1734 from atlassian/copy-results/add-retry-and-timeout
Copy results/add retry and timeout
2 parents 4d4f249 + 989ce32 commit fe69430

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

app/util/k8s/bzt_on_pod.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ kubectl exec -it "$exec_pod_name" -n atlassian -- docker run --shm-size=4g -v "/
6767
sleep 10
6868

6969
echo "INFO: Copy results folder from the exec env pod to local"
70-
kubectl exec -n atlassian "$exec_pod_name" -- tar cf - -C /dc-app-performance-toolkit/app results | tar xf - -C /data-center-terraform/dc-app-performance-toolkit/app/results --strip-components=1
70+
for _ in {1..3}; do
71+
if kubectl exec -n atlassian "$exec_pod_name" --request-timeout=60s -- tar czf - -C /dc-app-performance-toolkit/app results | tar xzf - -C /data-center-terraform/dc-app-performance-toolkit/app/results --strip-components=1; then
72+
break
73+
else
74+
echo "Copying failed, retrying..."
75+
sleep 5
76+
fi
77+
done
78+
7179
if [[ $? -ne 0 ]]; then
7280
echo "ERROR: Copy results folder failed"
7381
exit 1

app/util/k8s/copy_run_results.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ fi
3030
echo "INFO: Execution environment pod name: $exec_pod_name"
3131

3232
echo "INFO: Copy results folder from the exec env pod to local"
33-
kubectl exec -n atlassian "$exec_pod_name" -- tar cf - -C /dc-app-performance-toolkit/app results | tar xf - -C /data-center-terraform/dc-app-performance-toolkit/app/results --strip-components=1
33+
for _ in {1..3}; do
34+
if kubectl exec -n atlassian "$exec_pod_name" --request-timeout=60s -- tar czf - -C /dc-app-performance-toolkit/app results | tar xzf - -C /data-center-terraform/dc-app-performance-toolkit/app/results --strip-components=1; then
35+
break
36+
else
37+
echo "Copying failed, retrying..."
38+
sleep 5
39+
fi
40+
done
41+
3442
if [[ $? -ne 0 ]]; then
3543
echo "ERROR: Copy results folder failed"
3644
exit 1

0 commit comments

Comments
 (0)