1
0
forked from rosa/hakurei

cmd/mbf: do not abort cache acquisition during testing

This can sometimes fire during testing due to how short the test is.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-17 02:06:51 +09:00
parent 9daba60809
commit a394971dd7
3 changed files with 62 additions and 72 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"os"
"path/filepath"
"testing"
"hakurei.app/check"
"hakurei.app/internal/pkg"
@@ -53,6 +54,9 @@ func (cache *cache) open() (err error) {
go func() {
select {
case <-cache.ctx.Done():
if testing.Testing() {
return
}
os.Exit(2)
case <-done: