-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run ZnServerTest>>#testTooManyConcurrentConnections under #usingClass…
…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.
There are no files selected for viewing
47 changes: 24 additions & 23 deletions
47
...sitory/Zinc-Tests.package/ZnServerTest.class/instance/testTooManyConcurrentConnections.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ] ] |