Skip to content

Commit 27c9168

Browse files
committed
ci: add tests to check for races
This is not the kind of race that Go race detector would catch; this is a race when a /proc file of one thread is opened and when Go changes the underlying thread, and that different thread tries to write to that file descriptor. In order to catch those reliably, we need quite a big number of iterations, and we only need to test go-selinux stuff. I chose the count to be 100000 because it takes about 1 minute on my machine: [kir@kir-tp1 selinux]$ time go test -timeout 3m -count 100000 ./go-selinux ok github.com/opencontainers/selinux/go-selinux 53.763s real 0m53.983s user 0m30.030s sys 0m30.339s Also note that this only makes sense to run on a SELinux enabled systems (i.e. those we run under lima). Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 88a4437 commit 27c9168

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/validate.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,8 @@ jobs:
128128
129129
- name: "make test"
130130
run: lima make -C /tmp/selinux test
131+
132+
# https://github.com/opencontainers/selinux/issues/222
133+
# https://github.com/opencontainers/selinux/issues/225
134+
- name: "racy test"
135+
run: lima 'cd /tmp/selinux && go test -timeout 10m -count 100000 ./go-selinux'

0 commit comments

Comments
 (0)