Skip to content

test(falcor-socket-datasource): socket.io 2 + 4 compatibility matrix#18

Draft
lmeyerov wants to merge 1 commit into
masterfrom
feature/socketio-2-and-4-matrix
Draft

test(falcor-socket-datasource): socket.io 2 + 4 compatibility matrix#18
lmeyerov wants to merge 1 commit into
masterfrom
feature/socketio-2-and-4-matrix

Conversation

@lmeyerov

Copy link
Copy Markdown
Contributor

Adds a socket.io 2 ⇄ 4 compatibility matrix to the falcor-socket-datasource test suite, supporting the graphistry/graphistry socket.io 2.3 → 4.x migration (design: plans/viz-modernization/socketio-4-design.md; S1 of the sequencing).

What

test/tests.socket.js now runs the full FalcorPubSubDataSource ⇄ FalcorPubSubDataSink suite (get/set/call, streaming, and cancel-falcor-operation-<id> cancellation round trip) over real socket.io servers and clients in three combos:

Server Client Why
socket.io 2.3 socket.io-client 2.3 status quo (bumped from ~2.0 to match prod)
socket.io 4.8 socket.io-client 4.8 migration target (npm aliases socket.io-v4 / socket.io-client-v4)
socket.io 4.8 + allowEIO3: true socket.io-client 2.3 the Engine.IO 3 bridge staged rollouts rely on (server upgrades first)

This empirically confirms the design finding that the Source/Sink need zero changes for socket.io 4: they only use on/emit/removeListener, trailing acks, and dynamic event names — all unchanged in v4.

Also

  • Removed a stray it.only in tests.base.js that was masking every suite down to the single streaming-get test; all unmasked tests pass.
  • Teardown now closes the client socket and waits for the server port to free, so back-to-back suites on the shared port cannot cross-connect.
  • FALCOR_SOCKET_TEST_PORT env override (default remains 3000) for local runs where 3000 is occupied.

Verification

FALCOR_SOCKET_TEST_PORT=3300 npm test240 passing, exit 0 (node 22, mocha via babel-register).

Part of graphistry/graphistry#3250

🤖 Generated with Claude Code

Run the FalcorPubSubDataSource ⇄ FalcorPubSubDataSink suite over real
socket.io servers/clients in three combinations:

- socket.io v2 server ⇄ v2 client (status quo, bumped ~2.0 -> ~2.3 to
  match production)
- socket.io v4 server ⇄ v4 client (migration target, via npm aliases
  socket.io-v4 / socket.io-client-v4 @ 4.8.x)
- socket.io v4 server (allowEIO3: true) ⇄ v2 client — the Engine.IO 3
  bridge that staged rollouts rely on (server upgrades before clients)

The Source/Sink only use on/emit/removeListener + trailing acks +
dynamic event names, unchanged across socket.io 2 -> 4, so all combos
must behave identically — including get/set/call, streaming, and
cancellation (cancel-falcor-operation-<id> round trip).

Also:
- remove a stray it.only in tests.base.js that masked every suite down
  to the single streaming-get test (all unmasked tests pass)
- close client + server between suites so back-to-back suites on the
  shared port can't cross-connect, and make teardown wait for the port
- FALCOR_SOCKET_TEST_PORT env override (default stays 3000) for local
  runs where 3000 is taken

240 passing.

Part of graphistry/graphistry#3250

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant