dynflow 0.8.32 → 0.8.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynflow/testing/in_thread_executor.rb +1 -1
- data/lib/dynflow/testing/managed_clock.rb +11 -5
- data/lib/dynflow/version.rb +1 -1
- data/test/testing_test.rb +35 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 331deb991c6fe8d4617af49ce8072fe0edceef6f
|
4
|
+
data.tar.gz: 8de8181ec0b0451fefab469ee496172b8f1938dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90d6626cc3af5a24784985ac6efd3beb029a50524b899f3ba9028248ddd0952cab7d72f46284cb1595a2d8ec74512a4d0247a77e41011306ec5a237d51c18e43
|
7
|
+
data.tar.gz: 5db089dc8165ea98ad5677e8a4849e369c6329b856023084cdd6cc4b9ef4427a6bd39a59e8921be689ba3b03b7427138647b636ec02c386ff03610d2d5009631
|
@@ -17,15 +17,21 @@ module Dynflow
|
|
17
17
|
@pending_pings.sort!
|
18
18
|
end
|
19
19
|
|
20
|
-
def progress
|
20
|
+
def progress(ignored_subjects = [])
|
21
21
|
if next_ping = @pending_pings.shift
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
if !next_ping.what.respond_to?(:value) || !ignored_subjects.include?(next_ping.what.value)
|
23
|
+
# we are testing an isolated system = we can move in time
|
24
|
+
# without actually waiting
|
25
|
+
@current_time = next_ping.when
|
26
|
+
next_ping.apply
|
27
|
+
end
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
31
|
+
def progress_all(ignored_subjects = [])
|
32
|
+
progress(ignored_subjects) until @pending_pings.empty?
|
33
|
+
end
|
34
|
+
|
29
35
|
def current_time
|
30
36
|
@current_time ||= Time.now
|
31
37
|
end
|
data/lib/dynflow/version.rb
CHANGED
data/test/testing_test.rb
CHANGED
@@ -166,6 +166,41 @@ module Dynflow
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
+
describe 'in thread executor with unrelated events in clock' do
|
170
|
+
class PollingAction < ::Dynflow::Action
|
171
|
+
def run(event = nil)
|
172
|
+
if output[:suspended].nil?
|
173
|
+
output[:suspended] = true
|
174
|
+
suspend do |action|
|
175
|
+
world.clock.ping(action, 1000, nil)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
let :world do
|
182
|
+
WorldFactory.create_world(Dynflow::Testing::InThreadWorld)
|
183
|
+
end
|
184
|
+
|
185
|
+
let :execution_plan do
|
186
|
+
world.plan(PollingAction)
|
187
|
+
end
|
188
|
+
|
189
|
+
it 'processes unrelated events' do
|
190
|
+
q = Queue.new
|
191
|
+
20.times { |i| world.clock.ping q, 0.0002, :periodic_check_inbox }
|
192
|
+
|
193
|
+
f = world.execute(execution_plan.id)
|
194
|
+
|
195
|
+
# This deadlocks the test
|
196
|
+
f.wait
|
197
|
+
|
198
|
+
f.value.tap do |plan|
|
199
|
+
plan.state.must_equal :stopped
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
169
204
|
describe "in thread executor" do
|
170
205
|
let :world do
|
171
206
|
WorldFactory.create_world(Dynflow::Testing::InThreadWorld)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Necas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-11-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|