Title: [278345] trunk/LayoutTests
Revision
278345
Author
[email protected]
Date
2021-06-02 02:07:34 -0700 (Wed, 02 Jun 2021)

Log Message

Fix race condition in binary_wsh.py
https://bugs.webkit.org/show_bug.cgi?id=226464
<rdar://77356905>

Reviewed by Alex Christensen.

The web socket server was implemented to send 4 messages as soon as connection is opened and close the connection.
The client expects to correctly send a message before the connection is closed.
This is not guaranteed by the web socket server, in case the server is very fast closing the connection and the client very slow at sending its message.
Given the focus of the test is to validate binary data, change the web socket server to remove the potential race.

* http/tests/websocket/tests/hybi/inspector/binary_wsh.py:
(web_socket_transfer_data):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (278344 => 278345)


--- trunk/LayoutTests/ChangeLog	2021-06-02 08:43:13 UTC (rev 278344)
+++ trunk/LayoutTests/ChangeLog	2021-06-02 09:07:34 UTC (rev 278345)
@@ -1,3 +1,19 @@
+2021-06-02  Youenn Fablet  <[email protected]>
+
+        Fix race condition in binary_wsh.py
+        https://bugs.webkit.org/show_bug.cgi?id=226464
+        <rdar://77356905>
+
+        Reviewed by Alex Christensen.
+
+        The web socket server was implemented to send 4 messages as soon as connection is opened and close the connection.
+        The client expects to correctly send a message before the connection is closed.
+        This is not guaranteed by the web socket server, in case the server is very fast closing the connection and the client very slow at sending its message.
+        Given the focus of the test is to validate binary data, change the web socket server to remove the potential race.
+
+        * http/tests/websocket/tests/hybi/inspector/binary_wsh.py:
+        (web_socket_transfer_data):
+
 2021-05-28  Antoine Quint  <[email protected]>
 
         Hit-testing does not account for clip-path on <iframe>

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/binary_wsh.py (278344 => 278345)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/binary_wsh.py	2021-06-02 08:43:13 UTC (rev 278344)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/binary_wsh.py	2021-06-02 09:07:34 UTC (rev 278345)
@@ -1,6 +1,7 @@
 from mod_pywebsocket import common
 from mod_pywebsocket import stream
 
+from mod_pywebsocket import msgutil
 
 def web_socket_do_extra_handshake(request):
     pass
@@ -7,6 +8,8 @@
 
 
 def web_socket_transfer_data(request):
+    # Make sure to receive a message from client before sending messages.
+    client_message = msgutil.receive_message(request)
     messages_to_send = ['Hello, world!', 'Привет, Мир!', '', all_distinct_bytes()]
     for message in messages_to_send:
         # FIXME: Should use better API to send binary messages when pywebsocket supports it.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to