You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by adobewjl <wj...@163.com> on 2023/03/11 13:26:05 UTC

Reuse Jetty server between unit test class.

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 : - ).

Re: Reuse Jetty server between unit test class.

Posted by Yunze Xu <yz...@streamnative.io.INVALID>.
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 <wj...@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 : - ).