Fix data race in bulk import tests (#24897)

Этот коммит содержится в:
Ben Schumacher
2023-10-16 22:40:19 +02:00
коммит произвёл GitHub
родитель 1a12faaaae
Коммит 4408ece955
3 изменённых файлов: 54 добавлений и 1 удалений

Просмотреть файл

@@ -54,6 +54,12 @@ func TestContext(t testing.TB) *Context {
return EmptyContext(logger)
}
// Clone creates a shallow copy of Context, allowing clones to apply per-request changes.
func (c *Context) Clone() CTX {
cCopy := *c
return &cCopy
}
func (c *Context) T(translationID string, args ...any) string {
return c.t(translationID, args...)
}
@@ -125,6 +131,7 @@ func (c *Context) Logger() mlog.LoggerIFace {
}
type CTX interface {
Clone() CTX
T(string, ...interface{}) string
Session() *model.Session
RequestId() string