Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: SslConfiguration::setProtocol #9118

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
test: Deflake the BinaryWebSocketSpec (#8725)
  • Loading branch information
timyates authored and sdelamo committed Apr 17, 2023
commit 13b0cdd9d4b93227f4ae88445d15f2852019c4b4
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void onOpen(String topic, String username, WebSocketSession session) {
this.topic = topic;
this.username = username;
this.session = session;
System.out.println("Client session opened for username = " + username);
System.out.println("Client session " + session.getId() + " opened for username = " + username);
}

public String getTopic() {
Expand All @@ -72,7 +72,7 @@ public WebSocketSession getSession() {
@OnMessage
public void onMessage(
byte[] message) {
System.out.println("Client received message = " + new String(message));
System.out.println("Client " + username + " received message = " + new String(message));
replies.add(new String(message));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void onOpen(String topic, String username, WebSocketSession session) {
if(isValid(topic, session, openSession)) {
String msg = "[" + username + "] Joined!";
System.out.println("Server sending msg = " + msg);
openSession.sendSync(msg.getBytes());
openSession.sendAsync(msg.getBytes());
}
}
}
Expand All @@ -55,7 +55,7 @@ public void onMessage(
if(isValid(topic, session, openSession)) {
String msg = "[" + username + "] " + new String(message);
System.out.println("Server sending msg = " + msg);
openSession.sendSync(msg.getBytes());
openSession.sendAsync(msg.getBytes());
}
}
}
Expand All @@ -72,7 +72,7 @@ public void onClose(
if(isValid(topic, session, openSession)) {
String msg = "[" + username + "] Disconnected!";
System.out.println("Server sending msg = " + msg);
openSession.sendSync(msg.getBytes());
openSession.sendAsync(msg.getBytes());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@ import jakarta.inject.Singleton
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
import spock.lang.Issue
import spock.lang.Retry
import spock.lang.Specification
import spock.util.concurrent.PollingConditions

import java.nio.ByteBuffer
import java.nio.charset.StandardCharsets

@Retry
class BinaryWebSocketSpec extends Specification {

@Retry
void "test binary websocket exchange"() {
given:
EmbeddedServer embeddedServer = ApplicationContext.builder('micronaut.server.netty.log-level':'TRACE').run(EmbeddedServer)
Expand All @@ -69,7 +66,6 @@ class BinaryWebSocketSpec extends Specification {
fred.replies.size() == 1
}


when:"A message is sent"
fred.send("Hello bob!".bytes)

Expand All @@ -86,7 +82,6 @@ class BinaryWebSocketSpec extends Specification {

then:
conditions.eventually {

fred.replies.contains("[bob] Hi fred. How are things?")
fred.replies.size() == 2
bob.replies.contains("[fred] Hello bob!")
Expand All @@ -99,8 +94,6 @@ class BinaryWebSocketSpec extends Specification {

when:
bob.close()
sleep(1000)


then:
conditions.eventually {
Expand Down