@@ -100,7 +100,7 @@ func TestWorkerJamDuration(t *testing.T) {
100100 defaultWorkerPool := NewDefaultWorkerPool (fpgo .NewBufferedChannelQueue [func ()](3 , 10000 , 100 ), nil ).
101101 SetSpawnWorkerDuration (1 * time .Millisecond / 10 ).
102102 SetWorkerExpiryDuration (5 * time .Millisecond ).
103- SetWorkerJamDuration (3 * time .Millisecond ).
103+ SetWorkerJamDuration (3 * time .Millisecond ).
104104 SetWorkerSizeMaximum (10 ).
105105 SetWorkerSizeStandBy (3 ).
106106 SetWorkerBatchSize (0 )
@@ -109,14 +109,14 @@ func TestWorkerJamDuration(t *testing.T) {
109109
110110 // Test Spawn
111111 assert .Equal (t , 0 , defaultWorkerPool .workerCount )
112- anyOneDone := false
112+ anyOneDone := false
113113 for i := 0 ; i < 3 ; i ++ {
114114 v := i
115115 err = workerPool .Schedule (func () {
116116 // Nothing to do
117117 time .Sleep (20 * time .Millisecond )
118118 t .Log (v )
119- anyOneDone = true
119+ anyOneDone = true
120120 })
121121 assert .NoError (t , err )
122122 }
@@ -127,20 +127,20 @@ func TestWorkerJamDuration(t *testing.T) {
127127 // Though there're blocking jobs, but no newest job goes into the queue
128128 assert .Equal (t , 3 , defaultWorkerPool .workerCount )
129129 // There're new jobs going to the queue, and all goroutines are busy
130- workerPool .Schedule (func (){})
131- workerPool .Schedule (func (){})
132- workerPool .Schedule (func (){})
133- time .Sleep (3 * time .Millisecond )
130+ workerPool .Schedule (func () {})
131+ workerPool .Schedule (func () {})
132+ workerPool .Schedule (func () {})
133+ time .Sleep (3 * time .Millisecond )
134134 // A new expected goroutine is generated
135- assert .Equal (t , 4 , defaultWorkerPool .workerCount )
136- workerPool .Schedule (func (){})
137- workerPool .Schedule (func (){})
138- workerPool .Schedule (func (){})
135+ assert .Equal (t , 4 , defaultWorkerPool .workerCount )
136+ workerPool .Schedule (func () {})
137+ workerPool .Schedule (func () {})
138+ workerPool .Schedule (func () {})
139139 time .Sleep (3 * time .Millisecond )
140140 // Only non blocking jobs, thus keep the same amount
141141 assert .Equal (t , 4 , defaultWorkerPool .workerCount )
142142 // There's a blocking jobs going to the queue
143- workerPool .Schedule (func (){
143+ workerPool .Schedule (func () {
144144 time .Sleep (20 * time .Millisecond )
145145 t .Log (3 )
146146 anyOneDone = true
@@ -149,12 +149,12 @@ func TestWorkerJamDuration(t *testing.T) {
149149 // Though there're blocking jobs, but no newest job goes into the queue
150150 assert .Equal (t , 4 , defaultWorkerPool .workerCount )
151151 // There're new jobs going to the queue, and all goroutines are busy
152- workerPool .Schedule (func (){})
153- workerPool .Schedule (func (){})
154- workerPool .Schedule (func (){})
155- workerPool .Schedule (func (){})
156- assert .Equal (t , false , anyOneDone )
157- time .Sleep (1 * time .Millisecond )
152+ workerPool .Schedule (func () {})
153+ workerPool .Schedule (func () {})
154+ workerPool .Schedule (func () {})
155+ workerPool .Schedule (func () {})
156+ assert .Equal (t , false , anyOneDone )
157+ time .Sleep (1 * time .Millisecond )
158158 // A new expected goroutine is generated
159159 assert .Equal (t , 5 , defaultWorkerPool .workerCount )
160160}
0 commit comments