]> git.maquefel.me Git - brevno-suite/hugo/commit
resources: Fix race condition in test helper
authorSimon Heimlicher <simon.github@heimlicher.com>
Sat, 24 Jan 2026 14:41:29 +0000 (15:41 +0100)
committerGitHub <noreply@github.com>
Sat, 24 Jan 2026 14:41:29 +0000 (15:41 +0100)
commit48566b6f37dac88dfe975db7ae7f6e97fd296644
tree9b19c18a0b3989697fb98868708866bf7199bcfa
parentb441472b6907079ac58baa9b7c79f5d7ac7ce31c
resources: Fix race condition in test helper

The fetchResourceForSpec function was reusing a single ReadSeekCloser
across multiple goroutines, causing a race condition when
TestImageTransformConcurrent runs with imageProcWorkers > 1.

This was exposed by commit e569dd59a ("Misc webp performance work")
which increased imageProcWorkers from 1 to 2.

Fix by creating a new reader on each call to the open function.

Fixes race condition causing segfault on Apple Silicon.

Co-authored-by: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
resources/testhelpers_test.go