Commit 936bec94 authored by jerrrrry's avatar jerrrrry
Browse files

Update .gitlab-ci.yml

parent b002a294
Pipeline #3299 failed
...@@ -150,55 +150,55 @@ benchmark_wan2.1: ...@@ -150,55 +150,55 @@ benchmark_wan2.1:
# 备用方法:使用Python直接修改 # 备用方法:使用Python直接修改
python3 -c " python3 -c "
import re import re
with open('temp_test2.py', 'r') as f: with open('temp_test2.py', 'r') as f:
content = f.read() content = f.read()
# 使用正则表达式替换seed值 # 使用正则表达式替换seed值
content = re.sub(r'(\"seed\":\s*)\d+', r'\g<1>1234567890', content) content = re.sub(r'(\"seed\":\s*)\d+', r'\g<1>1234567890', content)
with open('temp_test2.py', 'w') as f: with open('temp_test2.py', 'w') as f:
f.write(content) f.write(content)
" "
# 再次验证 # 再次验证
if grep -q '"seed": 1234567890,' temp_test2.py; then if grep -q '"seed": 1234567890,' temp_test2.py; then
echo "✓ Seed 1234567890 successfully set using Python method" echo "✓ Seed 1234567890 successfully set using Python method"
grep -n '"seed": 1234567890,' temp_test2.py grep -n '"seed": 1234567890,' temp_test2.py
else else
echo "✗ All methods failed to set seed 1234567890" echo "✗ All methods failed to set seed 1234567890"
echo "Full file content for debugging:" echo "Full file content for debugging:"
cat temp_test2.py cat temp_test2.py
exit 1 exit 1
fi
fi fi
fi
# 记录开始时间
start_time=$(date +%s) # 记录开始时间
start_time=$(date +%s)
# 运行测试
python temp_test2.py > results/test2_output.log 2>&1 & # 运行测试
export TEST2_PID=$! python temp_test2.py > results/test2_output.log 2>&1 &
export TEST2_PID=$!
echo "Waiting for second webp file to be generated..."
# 等待第二个webp文件生成,最多等待10分钟 echo "Waiting for second webp file to be generated..."
timeout=600 # 等待第二个webp文件生成,最多等待10分钟
count=0 timeout=600
while [ $count -lt $timeout ]; do count=0
webp_count=$(find output -name "*.webp" -type f | wc -l) while [ $count -lt $timeout ]; do
if [ $webp_count -gt 1 ]; then webp_count=$(find output -name "*.webp" -type f | wc -l)
echo "Second webp file detected! Total count: $webp_count" if [ $webp_count -gt 1 ]; then
break echo "Second webp file detected! Total count: $webp_count"
fi break
sleep 2 fi
count=$((count+2)) sleep 2
echo "Waiting... ${count}s elapsed, webp count: $webp_count" count=$((count+2))
done echo "Waiting... ${count}s elapsed, webp count: $webp_count"
done
if [ $count -eq $timeout ]; then
echo "Timeout waiting for second webp file" if [ $count -eq $timeout ]; then
exit 1 echo "Timeout waiting for second webp file"
fi exit 1
fi
# 记录结束时间和计算执行时间 # 记录结束时间和计算执行时间
end_time=$(date +%s) end_time=$(date +%s)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment