Skip to content

Commit

Permalink
Run ZnServerTest>>#testTooManyConcurrentConnections under #usingClass…
Browse files Browse the repository at this point in the history
…icSocketStreamsOnWindowsDo:
  • Loading branch information
Sven Van Caekenberghe committed Feb 24, 2022
1 parent e73f0eb commit c6f2f61
Showing 1 changed file with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
testing
testTooManyConcurrentConnections
self withServerDo: [ :server | | client clients |
self deny: server debugMode.
server maximumNumberOfConcurrentConnections: 4.
clients := (1 to: 4) collect: [ :each |
ZnClient new
url: server localUrl;
addPathSegment: #random;
clientId: ('client-{1}' format: { each });
enforceHttpSuccess;
get;
yourself ].
client := ZnClient new
url: server localUrl;
addPathSegment: #random;
clientId: 'client-5';
get;
yourself.
self assert: client response code equals: 503.
clients do: [ :each |
each get; close ].
client get.
self assert: client isSuccess.
client close ]
self usingClassicSocketStreamsOnWindowsDo: [
self withServerDo: [ :server | | client clients |
self deny: server debugMode.
server maximumNumberOfConcurrentConnections: 4.
clients := (1 to: 4) collect: [ :each |
ZnClient new
url: server localUrl;
addPathSegment: #random;
clientId: ('client-{1}' format: { each });
enforceHttpSuccess;
get;
yourself ].
client := ZnClient new
url: server localUrl;
addPathSegment: #random;
clientId: 'client-5';
get;
yourself.
self assert: client response code equals: 503.
clients do: [ :each |
each get; close ].
client get.
self assert: client isSuccess.
client close ] ]

0 comments on commit c6f2f61

Please sign in to comment.