Skip to content

Commit ee3c2e6

Browse files
renovate[bot]Wikid82actions-user
authored
chore(deps): update dockerfile-non-major to v1.77.0 (#1087)
* chore(deps): update dockerfile-non-major to v1.77.0 * fix: eliminate TempDir cleanup race in database tests runQuickCheck ran as an untracked goroutine, leaving WAL/SHM file handles open when t.TempDir() cleanup fired, causing intermittent "directory not empty" failures. Introduce launchQuickCheck (defaults to the goroutine) so tests can override it to run synchronously via TestMain, ensuring the integrity check connection is closed before temp dirs are removed. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jeremy <jhatfield82@gmail.com> Co-authored-by: GitHub Actions <actions@github.com>
1 parent d3b3d0a commit ee3c2e6

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ RUN go get github.com/expr-lang/expr@v${EXPR_LANG_VERSION} && \
480480
# renovate: datasource=go depName=github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream
481481
go get github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream@v1.7.13 && \
482482
# renovate: datasource=go depName=github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs
483-
go get github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs@v1.76.0 && \
483+
go get github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs@v1.77.0 && \
484484
go get github.com/aws/aws-sdk-go-v2/service/kinesis@v1.43.7 && \
485485
go get github.com/aws/aws-sdk-go-v2/service/s3@v1.102.1 && \
486486
# CVE-2026-32952: go-ntlmssp DoS via malicious NTLM challenge response

backend/internal/database/database.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import (
1414
gormlogger "gorm.io/gorm/logger"
1515
)
1616

17+
// launchQuickCheck is called by Connect to run the integrity check goroutine.
18+
// Tests override this with a synchronous version to avoid cleanup races.
19+
var launchQuickCheck = func(dbPath string) { go runQuickCheck(dbPath) }
20+
1721
// Connect opens a SQLite database connection with optimized settings.
1822
// Uses WAL mode for better concurrent read/write performance.
1923
func Connect(dbPath string) (*gorm.DB, error) {
@@ -69,7 +73,7 @@ func Connect(dbPath string) (*gorm.DB, error) {
6973
// Run quick integrity check on startup in the background (warn-only), on
7074
// its own connection. The main pool is capped at one connection, so
7175
// sharing it here would still serialize migrations behind the check.
72-
go runQuickCheck(dbPath)
76+
launchQuickCheck(dbPath)
7377

7478
return db, nil
7579
}

backend/internal/database/database_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ import (
99
"github.com/stretchr/testify/require"
1010
)
1111

12+
func TestMain(m *testing.M) {
13+
// Run quick_check synchronously in tests so it completes before t.TempDir
14+
// cleanup runs. The goroutine version creates a race: the background
15+
// connection may still hold WAL/SHM files open when the temp dir is removed.
16+
launchQuickCheck = runQuickCheck
17+
os.Exit(m.Run())
18+
}
19+
1220
func TestConnect(t *testing.T) {
1321
t.Parallel()
1422
// Test with memory DB

0 commit comments

Comments
 (0)