You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Kirk Lund <kl...@pivotal.io> on 2016/03/18 21:42:02 UTC
cache.tier.sockets dunit tests have setup with sleep
I'm seeing lots of cache.tier.sockets dunit tests that have a setup method
which disconnectsAllFromDS() and then sleeps for 5 or 10 seconds before
continuing. Is there a valid reason for these tests to sleep at that point?
And if I were to change this to use Awaitility what condition would I need
to check for? In other words, why are they sleeping?
public RegisterInterestKeysDUnitTest(String name) {
super(name);
}
@Override
public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(5000);
final Host host = Host.getHost(0);
//Server1 VM
server1 = host.getVM(0);
//Server2 VM
server2 = host.getVM(1);
//Client 1 VM
client1 = host.getVM(2);
//client 2 VM
client2 = host.getVM(3);
createImpl();
for (int i=0; i<4; i++) {
host.getVM(i).invoke(getClass(), "createImpl", null);
}
-Kirk
Re: cache.tier.sockets dunit tests have setup with sleep
Posted by Udo Kohlmeyer <uk...@pivotal.io>.
+1. Agreed, this should not be an async action.
On 19/03/2016 9:18 am, Bruce Schuchardt wrote:
> I think you should take out the waits. If disconnectAllFromDS() is
> returning before things have shut down it should be fixed.
>
> Le 3/18/2016 1:42 PM, Kirk Lund a écrit :
>> I'm seeing lots of cache.tier.sockets dunit tests that have a setup
>> method
>> which disconnectsAllFromDS() and then sleeps for 5 or 10 seconds before
>> continuing. Is there a valid reason for these tests to sleep at that
>> point?
>> And if I were to change this to use Awaitility what condition would I
>> need
>> to check for? In other words, why are they sleeping?
>>
>> public RegisterInterestKeysDUnitTest(String name) {
>> super(name);
>> }
>>
>> @Override
>> public final void postSetUp() throws Exception {
>> disconnectAllFromDS();
>> Wait.pause(5000);
>>
>> final Host host = Host.getHost(0);
>> //Server1 VM
>> server1 = host.getVM(0);
>>
>> //Server2 VM
>> server2 = host.getVM(1);
>>
>> //Client 1 VM
>> client1 = host.getVM(2);
>>
>> //client 2 VM
>> client2 = host.getVM(3);
>>
>> createImpl();
>> for (int i=0; i<4; i++) {
>> host.getVM(i).invoke(getClass(), "createImpl", null);
>> }
>>
>>
>> -Kirk
>>
>
Re: cache.tier.sockets dunit tests have setup with sleep
Posted by Bruce Schuchardt <bs...@pivotal.io>.
I think you should take out the waits. If disconnectAllFromDS() is
returning before things have shut down it should be fixed.
Le 3/18/2016 1:42 PM, Kirk Lund a écrit :
> I'm seeing lots of cache.tier.sockets dunit tests that have a setup method
> which disconnectsAllFromDS() and then sleeps for 5 or 10 seconds before
> continuing. Is there a valid reason for these tests to sleep at that point?
> And if I were to change this to use Awaitility what condition would I need
> to check for? In other words, why are they sleeping?
>
> public RegisterInterestKeysDUnitTest(String name) {
> super(name);
> }
>
> @Override
> public final void postSetUp() throws Exception {
> disconnectAllFromDS();
> Wait.pause(5000);
>
> final Host host = Host.getHost(0);
> //Server1 VM
> server1 = host.getVM(0);
>
> //Server2 VM
> server2 = host.getVM(1);
>
> //Client 1 VM
> client1 = host.getVM(2);
>
> //client 2 VM
> client2 = host.getVM(3);
>
> createImpl();
> for (int i=0; i<4; i++) {
> host.getVM(i).invoke(getClass(), "createImpl", null);
> }
>
>
> -Kirk
>
Re: cache.tier.sockets dunit tests have setup with sleep
Posted by Dan Smith <ds...@pivotal.io>.
I'd say just go ahead and remove it and see what breaks. To me it looks
like that was just added out of superstition.
-Dan
On Fri, Mar 18, 2016 at 1:42 PM, Kirk Lund <kl...@pivotal.io> wrote:
> I'm seeing lots of cache.tier.sockets dunit tests that have a setup method
> which disconnectsAllFromDS() and then sleeps for 5 or 10 seconds before
> continuing. Is there a valid reason for these tests to sleep at that point?
> And if I were to change this to use Awaitility what condition would I need
> to check for? In other words, why are they sleeping?
>
> public RegisterInterestKeysDUnitTest(String name) {
> super(name);
> }
>
> @Override
> public final void postSetUp() throws Exception {
> disconnectAllFromDS();
> Wait.pause(5000);
>
> final Host host = Host.getHost(0);
> //Server1 VM
> server1 = host.getVM(0);
>
> //Server2 VM
> server2 = host.getVM(1);
>
> //Client 1 VM
> client1 = host.getVM(2);
>
> //client 2 VM
> client2 = host.getVM(3);
>
> createImpl();
> for (int i=0; i<4; i++) {
> host.getVM(i).invoke(getClass(), "createImpl", null);
> }
>
>
> -Kirk
>