1 Star 0 Fork 46

DriedYellowPeach/iSulad_1

forked from src-openEuler/iSulad 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0020-add-crictl-timeout-and-sync-for-CI.patch 4.31 KB
一键复制 编辑 原始数据 按行查看 历史
From 7941e0fcd8d7b8edb303a1661233fd9688c46819 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <[email protected]>
Date: Mon, 20 Feb 2023 15:42:40 +0800
Subject: [PATCH 20/53] add crictl timeout and sync for CI
Signed-off-by: zhangxiaoyu <[email protected]>
---
CI/test_cases/container_cases/bigdata_stream.sh | 7 +++++++
CI/test_cases/container_cases/bigdata_stream_runc.sh | 4 ++++
CI/test_cases/helpers.sh | 5 ++++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/CI/test_cases/container_cases/bigdata_stream.sh b/CI/test_cases/container_cases/bigdata_stream.sh
index 7e74d700..3bfc2d50 100755
--- a/CI/test_cases/container_cases/bigdata_stream.sh
+++ b/CI/test_cases/container_cases/bigdata_stream.sh
@@ -124,6 +124,7 @@ function test_concurrent_bigdata_stream()
pids[${#pids[@]}]=$!
done
wait ${pids[*]// /|}
+ sync && sync
for index in $(seq 1 5); do
ls -l /home/iocopy_stream_data_500M_$index
@@ -151,6 +152,7 @@ function test_concurrent_bigdata_stream_without_pty()
pids[${#pids[@]}]=$!
done
wait ${pids[*]// /|}
+ sync && sync
for index in $(seq 1 5); do
ls -l /home/iocopy_stream_data_500M_$index
@@ -209,6 +211,7 @@ function test_stream_with_stop_client()
kill -18 $pid
wait $pid
+ sync && sync
ls -l /home/iocopy_stream_data_500M
total_size=$(stat -c"%s" /home/iocopy_stream_data_500M)
@@ -254,6 +257,7 @@ function test_stream_with_stop_attach()
kill -18 $pid
wait $exec_pid
+ sync && sync
ls -l /home/iocopy_stream_data_500M
total_size=$(stat -c"%s" /home/iocopy_stream_data_500M)
@@ -299,6 +303,7 @@ function test_stream_with_stop_lxc_monitor()
kill -18 $pid
wait $exec_pid
+ sync && sync
ls -l /home/iocopy_stream_data_500M
total_size=$(stat -c"%s" /home/iocopy_stream_data_500M)
@@ -347,6 +352,7 @@ function test_stream_with_stop_isulad()
kill -18 $(cat /var/run/isulad.pid)
wait $pid
+ sync && sync
ls -l /home/iocopy_stream_data_500M
total_size=$(stat -c"%s" /home/iocopy_stream_data_500M)
@@ -397,6 +403,7 @@ function test_stream_with_runc()
isula exec -it $RUNCID cat test_500M > /home/iocopy_stream_data_500M
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to cat bigdata" && ((ret++))
+ sync && sync
total_size=$(stat -c"%s" /home/iocopy_stream_data_500M)
[[ $total_size -ne 524288000 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - stream iocopy loss data" && ((ret++))
diff --git a/CI/test_cases/container_cases/bigdata_stream_runc.sh b/CI/test_cases/container_cases/bigdata_stream_runc.sh
index 6933bef0..3a384cd8 100755
--- a/CI/test_cases/container_cases/bigdata_stream_runc.sh
+++ b/CI/test_cases/container_cases/bigdata_stream_runc.sh
@@ -117,6 +117,7 @@ function test_cat_bigdata()
pids[${#pids[@]}]=$!
done
wait ${pids[*]// /|}
+ sync && sync
for index in $(seq 1 5); do
ls -l /home/iocopy_stream_data_500M_$index
@@ -144,6 +145,7 @@ function test_cat_bigdata_without_pty()
pids[${#pids[@]}]=$!
done
wait ${pids[*]// /|}
+ sync && sync
for index in $(seq 1 5); do
ls -l /home/iocopy_stream_data_500M_$index
@@ -173,6 +175,7 @@ function test_stream_with_stop_client()
kill -18 $pid
wait $pid
+ sync && sync
ls -l /home/iocopy_stream_data_500M
total_size=$(stat -c"%s" /home/iocopy_stream_data_500M)
@@ -217,6 +220,7 @@ function test_stream_with_stop_isulad()
kill -18 $(cat /var/run/isulad.pid)
wait $pid
+ sync && sync
ls -l /home/iocopy_stream_data_500M
total_size=$(stat -c"%s" /home/iocopy_stream_data_500M)
diff --git a/CI/test_cases/helpers.sh b/CI/test_cases/helpers.sh
index bba4e7e3..5ea4ff94 100755
--- a/CI/test_cases/helpers.sh
+++ b/CI/test_cases/helpers.sh
@@ -69,7 +69,10 @@ function testcontainer() {
function crictl() {
CRICTL=$(which crictl)
- "$CRICTL" -i unix:///var/run/isulad.sock -r unix:///var/run/isulad.sock "$@"
+ # Default timeout is 2s.
+ # In some high IO testcase, isulad handle CRI request time maybe more than 2s.
+ # And the crictl will print error message "context deadline exceeded"
+ "$CRICTL" -i unix:///var/run/isulad.sock -r unix:///var/run/isulad.sock --timeout 5s "$@"
}
function msg_ok()
--
2.25.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/driedyellowpeach/iSulad_1.git
[email protected]:driedyellowpeach/iSulad_1.git
driedyellowpeach
iSulad_1
iSulad_1
master

搜索帮助