@@ -12,7 +12,7 @@ Class {
12
12
{ #category : ' accessing' }
13
13
RsrStressTest class >> defaultTimeLimit [
14
14
15
- ^ 30 seconds
15
+ ^ Duration seconds: 30
16
16
]
17
17
18
18
{ #category : ' testing' }
@@ -44,6 +44,12 @@ RsrStressTest >> concurrentlyRun: aBlock [
44
44
self deny: anyCurtailed
45
45
]
46
46
47
+ { #category : ' accessing' }
48
+ RsrStressTest >> defaultTestDuration [
49
+
50
+ ^ self class defaultTimeLimit / 2
51
+ ]
52
+
47
53
{ #category : ' initialize/release' }
48
54
RsrStressTest >> initializeServices [
49
55
@@ -63,19 +69,25 @@ RsrStressTest >> numThreads [
63
69
{ #category : ' running-utilities' }
64
70
RsrStressTest >> repeatedlyRun: aBlock [
65
71
66
- self repetitions timesRepeat: aBlock
72
+ | endTime |
73
+ endTime := DateAndTime now + self defaultTestDuration.
74
+ self
75
+ repeatedlyRun: aBlock
76
+ until: endTime
67
77
]
68
78
69
79
{ #category : ' running-utilities' }
70
- RsrStressTest >> repeatedlySend: anObject [
80
+ RsrStressTest >> repeatedlyRun: aBlock
81
+ until: endTime [
71
82
72
- self repeatedlyRun: [self send: anObject]
83
+ [DateAndTime now < endTime]
84
+ whileTrue: [aBlock value]
73
85
]
74
86
75
- { #category : ' accessing ' }
76
- RsrStressTest >> repetitions [
87
+ { #category : ' running-utilities ' }
88
+ RsrStressTest >> repeatedlySend: anObject [
77
89
78
- ^ 1000
90
+ self repeatedlyRun: [ self send: anObject]
79
91
]
80
92
81
93
{ #category : ' running-utilities' }
@@ -109,11 +121,7 @@ RsrStressTest >> tearDown [
109
121
{ #category : ' running' }
110
122
RsrStressTest >> test10MBytes [
111
123
112
- | bytes |
113
- bytes := ByteArray new : 1024 * 1024 * 10 .
114
- 1
115
- to: 10
116
- do: [:i | self send: bytes]
124
+ self repeatedlySend: (ByteArray new : 1024 * 1024 * 10 )
117
125
]
118
126
119
127
{ #category : ' running' }
0 commit comments