File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # This is validation script for "boom" tool https://github.com/tarekziade/boom
3
+ # To use it:
4
+ #
5
+ # boom -n1000 --post-hook=boom_uasyncio.validate <rest of boom args>
6
+ #
7
+ # Note that if you'll use other -n value, you should update NUM_REQS below
8
+ # to match.
9
+ #
10
+
11
+ NUM_REQS = 1000
12
+ seen = []
13
+ cnt = 0
14
+
15
+ def validate (resp ):
16
+ global cnt
17
+ t = resp .text
18
+ l = t .split ("\r \n " , 1 )[0 ]
19
+ no = int (l .split ()[1 ])
20
+ seen .append (no )
21
+ c = t .count (l + "\r \n " )
22
+ assert c == 400101
23
+ assert t .endswith ("=== END ===" )
24
+
25
+ cnt += 1
26
+ if cnt == NUM_REQS :
27
+ seen .sort ()
28
+ print
29
+ print seen
30
+ print
31
+ el = None
32
+ for i in seen :
33
+ if el is None :
34
+ el = i
35
+ else :
36
+ el += 1
37
+ assert i == el
38
+ return resp
You can’t perform that action at this time.
0 commit comments