+
Skip to content

Synctest support #1601

@wuzuf

Description

@wuzuf

Dear team,

Anyone looking at adding synctest support in Ginkgo?

It is really bringing a lot of value when testing asynchronous behaviors and I was wondering if it could be integrated directly in Ginkgo.

I managed to use it in my current test suites, here are the difficulties I faced:

  • Access to the *testing.T (needed to call synctest.Test). For now I am storing that in a package variable at the beginning of my test suite function.
  • All the BeforeEach are run outside if the "bubble", and it creates problems if they start goroutines or create channels. My workaround is to not relly on BeforeEach(func() {...}) and instead replace it with beforeEach = func() {...} and call the function inside the synctest.Test callback.

I did not check Ginkgo code in details, but I guess it would require another kind of It (or Describe) that starts the bubble before calling the BeforeEach...

I am raising this issue to poll for interest, I can also help on the coding part if needed. For now, my workarounds work for me, it makes just test cases a bit more convoluted when using synctest.

Thanks a lot for the feedback :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载