Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5-internal/deflake-maketarget
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a 'make flake-PATTERN' target to run a subset of tests multiple times to trigger a failure case in flaky tests
13 changes: 13 additions & 0 deletions services/brig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ i-list:
i-%:
INTEGRATION_USE_NGINZ=$(INTEGRATION_USE_NGINZ) ../integration.sh $(EXE_IT) -s $(NAME).integration.yaml -i ../integration.yaml -p "$*" $(WIRE_INTEGRATION_TEST_OPTIONS)


# Like integration-%, but starts services only once then runs a given test pattern $FLAKE_AMOUNT times until a failure is seen
FLAKE_FILE ?= /tmp/flake.sh
FLAKE_AMOUNT ?= 1000
flake-%: fast
echo 'set -ex' > $(FLAKE_FILE)
chmod +x $(FLAKE_FILE)
for i in $$(seq $(FLAKE_AMOUNT)); do \
echo "echo $$i" >> $(FLAKE_FILE); \
echo '$(EXE_IT) -s $(NAME).integration.yaml -i ../integration.yaml -p "$*" $(WIRE_INTEGRATION_TEST_OPTIONS)' >> $(FLAKE_FILE); \
done
INTEGRATION_USE_NGINZ=$(INTEGRATION_USE_NGINZ) ../integration.sh $(FLAKE_FILE)

.PHONY: integration
integration: fast i

Expand Down