# "ws(...).close" takes 60 seconds?

**URL:** <https://community.gatling.io/t/ws-close-takes-60-seconds/4116>\
**Category:** Gatling (Open-Source)\
**Created:** [January 11, 2018, 4:38am UTC](https://community.gatling.io/t/ws-close-takes-60-seconds/4116 "2018-01-11T04:38:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pouria](https://avatars.discourse-cdn.com/v4/letter/p/e56c9b/32.png) [@Pouria](https://community.gatling.io/u/Pouria)\
**Post date:** [January 11, 2018, 4:38am UTC](https://community.gatling.io/t/ws-close-takes-60-seconds/4116/1 "2018-01-11T04:38:43Z")

</div>

Hi All,

I have a simple scenario:

`

def openAndCloseWebsocket(authToken: String) = scenario(“Open and close a websocket connection”)  
.exec (  
ws(“acquire a websocket”)  
.open("/subscription")  
.queryParam(“auth”, authToken)  
)  
.exec(  
ws(“Send msg”)  
.sendText(pingJson)  
.check(wsAwait.within(5).until(1).regex("._Pong._"))  
)  
.exec(  
ws(“close the websocket”).close  
)

`

The scenario works fine and passes, except for the fact that closing the websocket takes 60 seconds every time. In fact, if I remove the very last `exec` (i.e. don’t close the socket), the scenario ends much more quickly. Still, I prefer to close the socket once I’m done with it.

Is this a gatling bug, or am I doing something wrong?

Cheers,  
Pouria

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 11, 2018, 8:40am UTC](https://community.gatling.io/t/ws-close-takes-60-seconds/4116/2 "2018-01-11T08:40:34Z")

</div>

Hi,

I tried to reproduce against the echo sample from [websocket.org](http://websocket.org) but everything works just fine.  
Could be something weird with your WebSocket server implementation.  
Impossible to investigate without you providing a full actionable reproducer.

Regards,
