Skip to content

Flaky test cache_test #32657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
silverwind opened this issue Nov 27, 2024 · 3 comments · Fixed by #33220
Closed

Flaky test cache_test #32657

silverwind opened this issue Nov 27, 2024 · 3 comments · Fixed by #33220

Comments

@silverwind
Copy link
Member

silverwind commented Nov 27, 2024

--- FAIL: TestTest (0.00s)
    cache_test.go:46: 
        	Error Trace:	/home/runner/work/gitea/gitea/modules/cache/cache_test.go:46
        	Error:      	"189.488µs" is not less than "100µs"
        	Test:       	TestTest
2024/11/27 04:45:56 ...les/cache/context.go:135:GetContextData() [W] cache context is expired, is highly likely to be misused for long-life tasks: &{map[system_setting:map[my_config1:1]] {{0 0} 0 0 {{} 0} {{} 0}} {13963910789408841798 6417129 0x1092460} false}
FAIL

https://github.com/go-gitea/gitea/actions/runs/12043787826/job/33579745667?pr=32649

@silverwind silverwind added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/testing and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Nov 27, 2024
@wxiaoguang
Copy link
Contributor

I still insist my point: it's not quite right to test cache by this approach.

#31265 (comment)

@TheFox0x7
Copy link
Contributor

This also impacts self-tests when using redis/memcache where the base delay is larger than the threshold and always triggers the slow warning

It would be better to make it informative instead of a warning or to make the threshold larger as it only works correctly in memory/twoqueue.
This could be also included in /metrics as histogram.

@6543 Pinging since you're the author of this - Is there any reason as to why 0.1 milliseconds?

@wxiaoguang
Copy link
Contributor

It believe it could be removed or changed.

@lunny lunny closed this as completed in 8c6d707 Jan 11, 2025
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jan 11, 2025
Change SlowCacheThreshold to 30 milliseconds so it doesn't trigger on
non memory cache

Closes: go-gitea#33190
Closes: go-gitea#32657
wxiaoguang pushed a commit that referenced this issue Jan 12, 2025
Backport #33220 by TheFox0x7

Change SlowCacheThreshold to 30 milliseconds so it doesn't trigger on
non memory cache

Closes: #33190
Closes: #32657

Co-authored-by: TheFox0x7 <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Apr 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants