Yeah, we should do that. There are many test classes that use BeforeMethod and AfterMethod for setup and teardown. We should use BeforeClass and AfterClass and take care of each single test to avoid affecting other tests in the same class.
Thanks, Yunze On Sat, Mar 11, 2023 at 9:26 PM adobewjl <wjl_is_...@163.com> wrote: > > I found some unit cost a lot time on setup and teardown jetty servlet server. > if we can reuse servlet server make it stateless. may be we can save a lot > developer time. > > > eg. > In UT `org.apache.pulsar.broker.admin.TopicPoliciesTest` > > > there are 80 test case. each set && tearDown will cost 6 seconds in my local > pc. > > > need some advice on this topic. I'm still new to the whole code base : - ).