ably-ruby icon indicating copy to clipboard operation
ably-ruby copied to clipboard

Failing test - authUrl JWT tests depend on external host

Open mattheworiordan opened this issue 6 years ago • 3 comments

rspec './spec/acceptance/realtime/auth_spec.rb[1:2:11:4:1]' # Ably::Realtime::Auth using MsgPack protocol when using JWT when JWT token expires client disconnects, a new token is requested via auth_callback and the client gets reconnected

This test intermittently fails possibly because it relies on a 3rd party endpoint echo.ably.io. That is not necessary given we can serve our own web server endpoint.

┆Issue is synchronized with this Jira Story by Unito

mattheworiordan avatar Aug 05 '19 23:08 mattheworiordan

For this particular issue the recommendations here is to run a local web server in the test and not to stub out the request. I am on mobile now so can't find other examples where this is done, but this approach has been done in a few places in the tests.

mattheworiordan avatar Oct 16 '20 17:10 mattheworiordan

@mattheworiordan Could you link example of how to run local web server?

piotrpawlik avatar Jan 06 '21 12:01 piotrpawlik

Agree that running a web server inside the test process would be better.

Just wanted to add that this problem is not unique to ably-ruby; we use echo.ably.io across many of our SDKs and recommend its use in the client library specification.

lawrence-forooghian avatar Apr 22 '24 19:04 lawrence-forooghian