File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,13 @@ Feature: Running scenarios in parallel with custom assignment
94
94
function step_def(name, delay) {
95
95
return function(scenario, cb) {
96
96
if (worker == null) worker = name;
97
- expect(worker).to.eq(name)
98
- expect(scenario).to.eq(++processed)
97
+ if (processed !== 3) {
98
+ expect(worker).to.eq(name)
99
+ expect(scenario).to.eq(++processed)
100
+ } else {
101
+ // Scenario 3 might get picked up by B as both are ready at this point
102
+ expect(scenario).to.eq(processed++)
103
+ }
99
104
setTimeout(cb, delay)
100
105
}
101
106
}
@@ -114,6 +119,10 @@ Feature: Running scenarios in parallel with custom assignment
114
119
Scenario: 2
115
120
Given scenario complex 2
116
121
122
+ @complex
123
+ Scenario: 3
124
+ Given scenario complex 3
125
+
117
126
@simple
118
127
Scenario: 4
119
128
Given scenario simple 1
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ export default class Coordinator {
101
101
this . saveDefinitionIdMapping ( message . supportCodeIds )
102
102
} else if ( message . ready ) {
103
103
worker . state = WorkerState . idle
104
- this . awakenWorkers ( )
104
+ this . awakenWorkers ( worker )
105
105
} else if ( doesHaveValue ( message . jsonEnvelope ) ) {
106
106
const envelope = messages . Envelope . fromObject (
107
107
JSON . parse ( message . jsonEnvelope )
@@ -158,17 +158,16 @@ export default class Coordinator {
158
158
}
159
159
}
160
160
161
- awakenWorkers ( ) : void {
162
- const workers = _ . values ( this . workers )
163
- _ . each ( workers , ( worker ) : boolean => {
161
+ awakenWorkers ( triggeringWorker : IWorker ) : void {
162
+ _ . each ( this . workers , ( worker ) : boolean => {
164
163
if ( worker . state === WorkerState . idle ) {
165
164
this . giveWork ( worker )
166
165
}
167
166
return worker . state !== WorkerState . idle
168
167
} )
169
168
170
169
if ( _ . isEmpty ( this . inProgressPickles ) && this . pickleIds . length > 0 ) {
171
- this . giveWork ( workers [ 0 ] , true )
170
+ this . giveWork ( triggeringWorker , true )
172
171
this . idleInterventions ++
173
172
}
174
173
}
You can’t perform that action at this time.
0 commit comments