onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.38k stars 660 forks source link

Using go func in It, It runs successfully, but I still get the error reported by ginkgo #1450

Closed ty-dc closed 3 months ago

ty-dc commented 3 months ago

The code using go func is as follows:

      errCh := make(chan error, testUser)
      wg := sync.WaitGroup{}
      wg.Add(testUser)
      for name, createFunc := range createFuncs {
      go func() {
          defer GinkgoRecover()
          defer wg.Done()
          if err := createPodSet(createFunc, name, time.Minute); err != nil {
              errCh <- err
              return
          }
      }()
      }
      wg.Wait()
      close(errCh)

It finally runs through, but I still get the error:

Ran 1 of 9 Specs in 393.220 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 8 Skipped

Ginkgo ran 18 suites in 6m59.224897858s

There were failures detected in the following suites:
create ./e2e/create

Can you give me some advice, how to deal with this problem? Thanks.