Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.util.concurrent.atomic.AtomicReference;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;

import ch.qos.logback.classic.spi.ILoggingEvent;
import io.reactivex.Completable;
Expand Down Expand Up @@ -2584,14 +2583,14 @@ public void throwFromOnHandlerRunsAllHandlers() {
value2.set(param1);
}, String.class);

hubConnection.start().timeout(1, TimeUnit.SECONDS).blockingAwait();
hubConnection.start().timeout(30, TimeUnit.SECONDS).blockingAwait();
mockTransport.receiveMessage("{\"type\":1,\"target\":\"inc\",\"arguments\":[\"Hello World\"]}" + RECORD_SEPARATOR);

// Confirming that our handler was called and the correct message was passed in.
assertEquals("Hello World", value1.get());
assertEquals("Hello World", value2.get());

hubConnection.stop().timeout(1, TimeUnit.SECONDS).blockingAwait();
hubConnection.stop().timeout(30, TimeUnit.SECONDS).blockingAwait();

ILoggingEvent log = logger.assertLog("Invoking client side method 'inc' failed:");
assertEquals("throw from on handler", log.getThrowableProxy().getMessage());
Expand Down Expand Up @@ -3190,15 +3189,14 @@ public void stopWithoutObservingWithLongPollingTransportStops() {
closed.onComplete();
});

hubConnection.start().timeout(1, TimeUnit.SECONDS).blockingAwait();
hubConnection.start().timeout(30, TimeUnit.SECONDS).blockingAwait();

hubConnection.stop();
closed.timeout(1, TimeUnit.SECONDS).blockingAwait();
closed.timeout(30, TimeUnit.SECONDS).blockingAwait();
blockGet.onComplete();
assertEquals(HubConnectionState.DISCONNECTED, hubConnection.getConnectionState());
}

@Disabled
@Test
public void hubConnectionClosesAndRunsOnClosedCallbackAfterCloseMessageWithLongPolling() {
AtomicInteger requestCount = new AtomicInteger(0);
Expand Down Expand Up @@ -3229,12 +3227,12 @@ public void hubConnectionClosesAndRunsOnClosedCallbackAfterCloseMessageWithLongP
hubConnection.onClosed((ex) -> {
closed.onComplete();
});
hubConnection.start().timeout(1, TimeUnit.SECONDS).blockingAwait();
hubConnection.start().timeout(30, TimeUnit.SECONDS).blockingAwait();

assertEquals(HubConnectionState.CONNECTED, hubConnection.getConnectionState());
blockGet.onComplete();

closed.timeout(1, TimeUnit.SECONDS).blockingAwait();
closed.timeout(30, TimeUnit.SECONDS).blockingAwait();

assertEquals(HubConnectionState.DISCONNECTED, hubConnection.getConnectionState());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public void ErrorFromClosePropagatesOnSecondStopCall() {
Map<String, String> headers = new HashMap<>();
LongPollingTransport transport = new LongPollingTransport(headers, client, Single.just(""));

transport.start("http://example.com").timeout(100, TimeUnit.SECONDS).blockingAwait();
transport.start("http://example.com").timeout(30, TimeUnit.SECONDS).blockingAwait();

RuntimeException exception = assertThrows(RuntimeException.class, () -> transport.stop().blockingAwait(100, TimeUnit.SECONDS));
assertEquals("Request has no handler: DELETE http://example.com", exception.getMessage());
Expand Down