@@ -86,33 +86,33 @@ def subscribe(plan, owner = self.user)
86
86
before { create_jobs ( 1 , private : true , state : :started ) }
87
87
before { create_jobs ( 5 , private : true ) }
88
88
89
- it { expect ( selected . size ) . to eq 1 }
90
- it { expect ( reports ) . to include 'user svenfuchs capacities: public max=3, plan max=2 ' }
91
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=2 selected=1 ' }
92
- it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=1 total_waiting=4 waiting_for_concurrency=4 ' }
89
+ it { expect ( selected . size ) . to eq 2 }
90
+ it { expect ( reports ) . to include 'user svenfuchs capacities: public max=3, plan max=3 ' }
91
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=3 selected=2 ' }
92
+ it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=2 total_waiting=3 waiting_for_concurrency=3 ' }
93
93
end
94
94
95
95
describe 'with public jobs only' do
96
96
before { create_jobs ( 1 , private : false , state : :started ) }
97
97
before { create_jobs ( 5 , private : false ) }
98
98
99
- it { expect ( selected . size ) . to eq 4 }
100
- it { expect ( reports ) . to include 'user svenfuchs capacities: public max=3, plan max=2 ' }
99
+ it { expect ( selected . size ) . to eq 5 }
100
+ it { expect ( reports ) . to include 'user svenfuchs capacities: public max=3, plan max=3 ' }
101
101
it { expect ( reports ) . to include 'user svenfuchs public capacity: running=1 max=3 selected=2' }
102
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=0 max=2 selected=2 ' }
103
- it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=4 total_waiting=1 waiting_for_concurrency=1 ' }
102
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=0 max=3 selected=3 ' }
103
+ it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=5 total_waiting=0 waiting_for_concurrency=0 ' }
104
104
end
105
105
106
106
describe 'for mixed public and private jobs' do
107
107
before { create_jobs ( 1 , private : true , state : :started ) }
108
108
before { create_jobs ( 1 , private : false , state : :started ) }
109
109
before { create_jobs ( 2 , private : false ) + create_jobs ( 2 , private : true ) }
110
110
111
- it { expect ( selected . size ) . to eq 3 }
112
- it { expect ( reports ) . to include 'user svenfuchs capacities: public max=3, plan max=2 ' }
111
+ it { expect ( selected . size ) . to eq 4 }
112
+ it { expect ( reports ) . to include 'user svenfuchs capacities: public max=3, plan max=3 ' }
113
113
it { expect ( reports ) . to include 'user svenfuchs public capacity: running=1 max=3 selected=2' }
114
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=2 selected=1 ' }
115
- it { expect ( reports ) . to include 'user svenfuchs: queueable=4 running=2 selected=3 total_waiting=1 waiting_for_concurrency=1 ' }
114
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=3 selected=2 ' }
115
+ it { expect ( reports ) . to include 'user svenfuchs: queueable=4 running=2 selected=4 total_waiting=0 waiting_for_concurrency=0 ' }
116
116
end
117
117
end
118
118
@@ -232,30 +232,30 @@ def subscribe(plan, owner = self.user)
232
232
before { create_jobs ( 1 , private : true , state : :started ) }
233
233
before { create_jobs ( 5 , private : true ) }
234
234
235
- it { expect ( selected . size ) . to eq 1 }
236
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=2 selected=1 ' }
237
- it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=1 total_waiting=4 waiting_for_concurrency=4 ' }
235
+ it { expect ( selected . size ) . to eq 2 }
236
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=3 selected=2 ' }
237
+ it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=2 total_waiting=3 waiting_for_concurrency=3 ' }
238
238
end
239
239
240
240
describe 'with public jobs only' do
241
241
before { create_jobs ( 1 , private : false , state : :started ) }
242
242
before { create_jobs ( 5 , private : false ) }
243
243
244
- it { expect ( selected . size ) . to eq 4 }
244
+ it { expect ( selected . size ) . to eq 5 }
245
245
it { expect ( reports ) . to include 'user svenfuchs public capacity: running=1 max=3 selected=2' }
246
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=0 max=2 selected=2 ' }
247
- it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=4 total_waiting=1 waiting_for_concurrency=1 ' }
246
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=0 max=3 selected=3 ' }
247
+ it { expect ( reports ) . to include 'user svenfuchs: queueable=5 running=1 selected=5 total_waiting=0 waiting_for_concurrency=0 ' }
248
248
end
249
249
250
250
describe 'for mixed public and private jobs' do
251
251
before { create_jobs ( 1 , private : true , state : :started ) }
252
252
before { create_jobs ( 1 , private : false , state : :started ) }
253
253
before { create_jobs ( 2 , private : false ) + create_jobs ( 2 , private : true ) }
254
254
255
- it { expect ( selected . size ) . to eq 3 }
255
+ it { expect ( selected . size ) . to eq 4 }
256
256
it { expect ( reports ) . to include 'user svenfuchs public capacity: running=1 max=3 selected=2' }
257
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=2 selected=1 ' }
258
- it { expect ( reports ) . to include 'user svenfuchs: queueable=4 running=2 selected=3 total_waiting=1 waiting_for_concurrency=1 ' }
257
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=1 max=3 selected=2 ' }
258
+ it { expect ( reports ) . to include 'user svenfuchs: queueable=4 running=2 selected=4 total_waiting=0 waiting_for_concurrency=0 ' }
259
259
end
260
260
end
261
261
@@ -381,7 +381,7 @@ def subscribe(plan, owner = self.user)
381
381
382
382
it { expect ( selected . size ) . to eq 3 }
383
383
it { expect ( reports ) . to include 'user svenfuchs limited by queue builds.osx: max=3 rejected=7 selected=2' }
384
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=2 max=10 selected=3' }
384
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=2 max=11 selected=3' }
385
385
it { expect ( reports ) . to include 'user svenfuchs: queueable=10 running=2 selected=3 total_waiting=7 waiting_for_concurrency=0' }
386
386
end
387
387
@@ -394,7 +394,7 @@ def subscribe(plan, owner = self.user)
394
394
it { expect ( selected . size ) . to eq 3 }
395
395
it { expect ( reports ) . to include 'user svenfuchs limited by queue builds.osx: max=3 rejected=7 selected=2' }
396
396
it { expect ( reports ) . to include 'user svenfuchs public capacity: running=2 max=3 selected=1' }
397
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=0 max=10 selected=2' }
397
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=0 max=11 selected=2' }
398
398
it { expect ( reports ) . to include 'user svenfuchs: queueable=10 running=2 selected=3 total_waiting=7 waiting_for_concurrency=0' }
399
399
end
400
400
@@ -409,7 +409,7 @@ def subscribe(plan, owner = self.user)
409
409
it { expect ( selected . size ) . to eq 4 }
410
410
it { expect ( reports ) . to include 'user svenfuchs limited by queue builds.osx: max=3 rejected=6 selected=2' }
411
411
it { expect ( reports ) . to include 'user svenfuchs public capacity: running=0 max=3 selected=1' }
412
- it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=2 max=10 selected=3' }
412
+ it { expect ( reports ) . to include 'user svenfuchs plan capacity: running=2 max=11 selected=3' }
413
413
it { expect ( reports ) . to include 'user svenfuchs: queueable=10 running=2 selected=4 total_waiting=6 waiting_for_concurrency=0' }
414
414
end
415
415
end
0 commit comments