Skip to content

Commit

Permalink
Fixed message_spec flaky test, implemented publish after subscribing …
Browse files Browse the repository at this point in the history
…to channel
  • Loading branch information
sacOO7 committed Jun 14, 2024
1 parent eb300d9 commit 194b537
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/acceptance/realtime/message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,13 @@ def publish_and_check_extras(extras)
let(:payload) { MessagePack.pack({ 'key' => random_str }) }

it 'does not attempt to decrypt the message' do
unencrypted_channel_client1.publish 'example', payload
encrypted_channel_client2.subscribe do |message|
expect(message.data).to eql(payload)
expect(message.encoding).to be_nil
stop_reactor
wait_until(lambda { client.connection.state == :connected and other_client.connection.state == :connected }) do
encrypted_channel_client2.subscribe do |message|
expect(message.data).to eql(payload)
expect(message.encoding).to be_nil
stop_reactor
end
unencrypted_channel_client1.publish 'example', payload
end
end
end
Expand Down

0 comments on commit 194b537

Please sign in to comment.