Merge c58089110a51c9e0fa585c5a1c962ca989251359 into 0f09c3a9b4626d9fe9979cf4d0521d6ae32ab646

This commit is contained in:
Samiul Sk 2026-10-13 02:07:25 -07:00 committed by GitHub
commit 104f6a790f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -800,6 +800,29 @@ func TestContextCopyNilErrorsAndAccepted(t *testing.T) {
assert.Nil(t, cp.Accepted)
}
func TestContextCopyRace(t *testing.T) {
c := &Context{}
var wg sync.WaitGroup
wg.Add(2)
go func() {
defer wg.Done()
for range 1000 {
c.Set("foo", "bar")
}
}()
go func() {
defer wg.Done()
for range 1000 {
c.Copy()
}
}()
wg.Wait()
}
func TestContextHandlerName(t *testing.T) {
c, _ := CreateTestContext(httptest.NewRecorder())
c.handlers = HandlersChain{func(c *Context) {}, handlerNameTest}