Use t.TempDir for SQLite databases, so tests don't rip out each others databases (#2950)

This should hopefully finally fix issues about `disk I/O error` as seen
[here](https://gitlab.alpinelinux.org/alpine/aports/-/jobs/955030/raw)

Hopefully this will also fix `SSL accept attempt failed` issues by
disabling HTTP keep alives when generating a config for CI.
This commit is contained in:
Till 2023-01-23 13:17:15 +01:00 committed by GitHub
parent 430932f0f1
commit 48fa869fa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 31 deletions

View file

@ -24,6 +24,7 @@ import (
"path/filepath"
"runtime"
"strings"
"sync"
"github.com/matrix-org/util"
@ -37,6 +38,7 @@ import (
// this unfortunately results in us adding the same hook multiple times.
// This map ensures we only ever add one level hook.
var stdLevelLogAdded = make(map[logrus.Level]bool)
var levelLogAddedMu = &sync.Mutex{}
type utcFormatter struct {
logrus.Formatter

View file

@ -85,6 +85,8 @@ func checkSyslogHookParams(params map[string]interface{}) {
}
func setupStdLogHook(level logrus.Level) {
levelLogAddedMu.Lock()
defer levelLogAddedMu.Unlock()
if stdLevelLogAdded[level] {
return
}