aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-02-15 13:03:38 +0700
committerShulhan <ms@kilabit.info>2026-02-15 13:37:31 +0700
commit19d58e9a4c900aec1d63de45a655657c760b1235 (patch)
tree959af0093d9ed2aca4976c69deb25a2d48fca44b /Makefile
parent827a2741e4fcb8e6feb5bf76acb20799c2913451 (diff)
downloadawwan-19d58e9a4c900aec1d63de45a655657c760b1235.tar.xz
all: fix data race in Play and in integration tests
When the Play command executed from the web user interface, there is a possibility that concurrent requests set the sshConfig field in Awwan struct at the same time. In the integration tests for TestAwwan_Play_withLocal and TestExecLocal_sudo, the data race happens when writing to the same buffer for stdout and stderr, so we split them into separate buffers. There is also data race in SSE connection, when handler for ExecuteTail write to the same buffer with worker keep alive. This has been fixed on pakakeh.go module.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index b35ae16..25b5b4d 100644
--- a/Makefile
+++ b/Makefile
@@ -70,10 +70,12 @@ build-awwan-test:
## time without rebuilding again.
.PHONY: test-integration
+test-integration: CGO_ENABLED=1
test-integration:
- go test -tags=integration -c .
+ go test -race -tags=integration -c .
machinectl shell awwan@awwan-test \
- /bin/sh -c "cd src; ./awwan.test"
+ /bin/sh -c "cd src; \
+ ./awwan.test -test.failfast -test.timeout=2m -test.v"
.PHONY: test-all
test-all: CGO_ENABLED=1
@@ -85,7 +87,7 @@ test-all:
go test -failfast -timeout=2m -race \
-coverprofile=$(COVER_OUT) \
-tags=integration \
- ./...
+ ./..."
go tool cover -html=$(COVER_OUT) -o $(COVER_HTML)
#}}}