Update Makefile for Enhanced Test Timeout Management

- Increased the timeout for AI unit tests from 20 minutes to 20 minutes and for memory leak tests from 60 seconds to 5 minutes, improving test execution reliability.
- Adjusted test commands to ensure proper handling of long-running tests, enhancing overall testing efficiency.
This commit is contained in:
Max 2025-12-15 10:37:23 +08:00
parent 1cc513e328
commit 069d183b35

View file

@ -76,7 +76,7 @@ unit-test-core:
unit-test-ai: unit-test-ai:
echo "mode: count" > coverage-ai.out echo "mode: count" > coverage-ai.out
for d in $(TESTFOLDER_AI); do \ for d in $(TESTFOLDER_AI); do \
$(GO) test -tags $(TESTTAGS) -v -covermode=count -coverprofile=profile.out -coverpkg=$$(echo $$d | sed "s/\/test$$//g") -skip='TestMemoryLeak|TestIsolateDisposal' $$d > tmp.out; \ $(GO) test -tags $(TESTTAGS) -v -timeout=20m -covermode=count -coverprofile=profile.out -coverpkg=$$(echo $$d | sed "s/\/test$$//g") -skip='TestMemoryLeak|TestIsolateDisposal' $$d > tmp.out; \
cat tmp.out; \ cat tmp.out; \
if grep -q "^--- FAIL" tmp.out; then \ if grep -q "^--- FAIL" tmp.out; then \
rm tmp.out; \ rm tmp.out; \
@ -135,7 +135,7 @@ memory-leak:
echo ""; \ echo ""; \
echo "🔍 Memory Leak Detection: $$d"; \ echo "🔍 Memory Leak Detection: $$d"; \
echo "---------------------------------------------"; \ echo "---------------------------------------------"; \
$(GO) test -run='TestMemoryLeak|TestIsolateDisposal|TestGoroutineLeak' -v -timeout=60s $$d || exit 1; \ $(GO) test -run='TestMemoryLeak|TestIsolateDisposal|TestGoroutineLeak' -v -timeout=5m $$d || exit 1; \
fi; \ fi; \
done done
@echo "" @echo ""