MCPcopy Index your code
hub / github.com/upper/db / Test_Issue340_MaxOpenConns

Method Test_Issue340_MaxOpenConns

adapter/postgresql/postgresql_test.go:806–827  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

804}
805
806func (s *AdapterTests) Test_Issue340_MaxOpenConns() {
807 sess := s.Session()
808
809 sess.SetMaxOpenConns(5)
810
811 var wg sync.WaitGroup
812 for i := 0; i < 30; i++ {
813 wg.Add(1)
814 go func(i int) {
815 defer wg.Done()
816
817 _, err := sess.SQL().Exec(fmt.Sprintf(`SELECT pg_sleep(1.%d)`, i))
818 if err != nil {
819 s.T().Errorf("%v", err)
820 }
821 }(i)
822 }
823
824 wg.Wait()
825
826 sess.SetMaxOpenConns(0)
827}
828
829func (s *AdapterTests) Test_Issue370_InsertUUID() {
830 sess := s.Session()

Callers

nothing calls this directly

Calls 7

SessionMethod · 0.65
SetMaxOpenConnsMethod · 0.65
DoneMethod · 0.65
ExecMethod · 0.65
SQLMethod · 0.65
ErrorfMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected