Skip to content

Commit

Permalink
Fix racy check for connecting state; reinstate disabled capability-ba…
Browse files Browse the repository at this point in the history
…sed test
  • Loading branch information
paddybyers committed Aug 8, 2017
1 parent 09b6da8 commit c2f1ebb
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import io.ably.lib.transport.ConnectionManager;
import io.ably.lib.transport.Defaults;
import io.ably.lib.types.PresenceMessage.Action;
import io.ably.lib.util.Log;

public class RealtimePresenceTest extends ParameterizedTest {

Expand Down Expand Up @@ -2404,7 +2405,6 @@ public void onError(ErrorInfo reason) {
channelWaiter.waitFor(ChannelState.attached);

/* Wait for reconnect */
connectionWaiter.waitFor(ConnectionState.connecting, 2);
connectionWaiter.waitFor(ConnectionState.connected, 2);

client2Channel.presence.unsubscribe();
Expand Down Expand Up @@ -2701,7 +2701,7 @@ public void onChannelStateChanged(ChannelStateChange stateChange) {
*
* Not functional yet
*/
//@Test
@Test
public void presence_without_subscribe_capability() throws AblyException {
String channelName = "presence_without_subscribe" + testParams.name;
AblyRealtime ably = null;
Expand Down Expand Up @@ -2825,9 +2825,8 @@ public void presence_enter_without_permission() throws AblyException {
ably = new AblyRealtime(opts);

Channel channel = ably.channels.get(channelName);
channel.attach();

ChannelWaiter channelWaiter = new ChannelWaiter(channel);
channel.attach();
channelWaiter.waitFor(ChannelState.attached);

CompletionWaiter enterWaiter = new CompletionWaiter();
Expand Down

0 comments on commit c2f1ebb

Please sign in to comment.