Skip to content

Commit 8ca5f73

Browse files
committed
Use a CPU-aware test comparison load limit
1 parent f528aff commit 8ca5f73

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,16 @@ vet: $(GO)
211211
test: test-aot-runtime test-glj # vet
212212
($(MAKE) test-suite v=1 || $(MAKE) test-suite v=1) || $(MAKE) test-suite v=1
213213

214+
TEST-COMPARE-LOAD := $(shell \
215+
processors=$$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2); \
216+
awk -v processors="$$processors" \
217+
'BEGIN { threshold = processors * 0.75; \
218+
print (threshold < 1 ? 1 : threshold) }')
219+
214220
test-compare: $(YS)
215221
@scripts/make-test-compare \
216222
'$(if $(with),$(with),origin/main)' '$(file)' \
217-
'$(if $(load),$(load),1.0)'
223+
'$(if $(load),$(load),$(TEST-COMPARE-LOAD))'
218224

219225
test-aot-runtime: $(GO)
220226
go test -tags glj_aot_runtime ./pkg/glj ./pkg/gljmain ./pkg/runtime

0 commit comments

Comments
 (0)