A lot of global lock test errors #13627

Closed
opened 2025-11-02 10:48:42 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @wxiaoguang on GitHub (Oct 23, 2024).

--- FAIL: TestLockAndDo (15.23s)
    --- FAIL: TestLockAndDo/redis (15.00s)
        globallock_test.go:89: 
            	Error Trace:	/home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89
            	            				/opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700
            	Error:      	Received unexpected error:
            	            	lock already taken, locked nodes: [0]
            	Test:       	TestLockAndDo/redis
        globallock_test.go:89: 
            	Error Trace:	/home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89
            	            				/opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700
            	Error:      	Received unexpected error:
            	            	lock already taken, locked nodes: [0]
            	Test:       	TestLockAndDo/redis

...
...
...
         globallock_test.go:89: 
            	Error Trace:	/home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89
            	            				/opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700
            	Error:      	Received unexpected error:
            	            	lock already taken, locked nodes: [0]
            	Test:       	TestLockAndDo/redis
        globallock_test.go:89: 
            	Error Trace:	/home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89
            	            				/opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700
            	Error:      	Received unexpected error:
            	            	lock already taken, locked nodes: [0]
            	Test:       	TestLockAndDo/redis
        globallock_test.go:95: 
            	Error Trace:	/home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:95
            	            				/home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:43
            	Error:      	Not equal: 
            	            	expected: 1000
            	            	actual  : 776
            	Test:       	TestLockAndDo/redis
FAIL
coverage: 91.8% of statements
FAIL	code.gitea.io/gitea/modules/globallock	23.286s
Originally created by @wxiaoguang on GitHub (Oct 23, 2024). ``` --- FAIL: TestLockAndDo (15.23s) --- FAIL: TestLockAndDo/redis (15.00s) globallock_test.go:89: Error Trace: /home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89 /opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700 Error: Received unexpected error: lock already taken, locked nodes: [0] Test: TestLockAndDo/redis globallock_test.go:89: Error Trace: /home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89 /opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700 Error: Received unexpected error: lock already taken, locked nodes: [0] Test: TestLockAndDo/redis ... ... ... globallock_test.go:89: Error Trace: /home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89 /opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700 Error: Received unexpected error: lock already taken, locked nodes: [0] Test: TestLockAndDo/redis globallock_test.go:89: Error Trace: /home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:89 /opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700 Error: Received unexpected error: lock already taken, locked nodes: [0] Test: TestLockAndDo/redis globallock_test.go:95: Error Trace: /home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:95 /home/runner/work/gitea/gitea/modules/globallock/globallock_test.go:43 Error: Not equal: expected: 1000 actual : 776 Test: TestLockAndDo/redis FAIL coverage: 91.8% of statements FAIL code.gitea.io/gitea/modules/globallock 23.286s ```
GiteaMirror added the type/bug label 2025-11-02 10:48:42 -06:00
Author
Owner

@wolfogre commented on GitHub (Oct 23, 2024):

How were these errors reproduced? Is it possible that the previous test was aborted and the lock was not released, and the test was restarted before the lock expired?

@wolfogre commented on GitHub (Oct 23, 2024): How were these errors reproduced? Is it possible that the previous test was aborted and the lock was not released, and the test was restarted before the lock expired?
Author
Owner

@lunny commented on GitHub (Oct 23, 2024):

I cannot reproduce it on my local machine. macOS go1.23.2 run with TEST_REDIS_URL=redis://127.0.0.1:6379/15 go test -tags=sqlite -run=TestLockAndDo.

@lunny commented on GitHub (Oct 23, 2024): I cannot reproduce it on my local machine. macOS go1.23.2 run with `TEST_REDIS_URL=redis://127.0.0.1:6379/15 go test -tags=sqlite -run=TestLockAndDo`.
Author
Owner

@wxiaoguang commented on GitHub (Oct 23, 2024):

How were these errors reproduced? Is it possible that the previous test was aborted and the lock was not released, and the test was restarted before the lock expired?

No idea, I just caught it from github actions. https://github.com/go-gitea/gitea/actions/runs/11459790779/job/31885087438

@wxiaoguang commented on GitHub (Oct 23, 2024): > How were these errors reproduced? Is it possible that the previous test was aborted and the lock was not released, and the test was restarted before the lock expired? No idea, I just caught it from github actions. https://github.com/go-gitea/gitea/actions/runs/11459790779/job/31885087438
Author
Owner

@wxiaoguang commented on GitHub (Dec 11, 2024):

It fails a lot, probability > 5% or 10%

@wxiaoguang commented on GitHub (Dec 11, 2024): It fails a lot, probability > 5% or 10%
Author
Owner

@wxiaoguang commented on GitHub (Apr 23, 2025):

The root problem is that the global lock (redis) implementation is not right. But I guess I won't spend more time on it. Even if the lock goes wrong, end users won't be hurt too much at the moment.

@wxiaoguang commented on GitHub (Apr 23, 2025): The root problem is that the global lock (redis) implementation is not right. But I guess I won't spend more time on it. Even if the lock goes wrong, end users won't be hurt too much at the moment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13627