specwrk 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1736573f9c3fc84992518a7a2ea486c03eefe4885b8b857a79b15551533deec0
4
- data.tar.gz: 7106e3b4c856bfd9ff89e5fe562ba3da45ad5981356b295e24b55579aa48609f
3
+ metadata.gz: e1dc8711d21ad65ad789e80317fb8fb61e2eda33397cfbb5aaf7de6209429781
4
+ data.tar.gz: 3d25ac4538e24d6a9190593b66a1510677c17f10c6f66dd3a30e3d815091937c
5
5
  SHA512:
6
- metadata.gz: 067222d93a38d847886d40b5a5121e24d68f633115ecfddccdd7c199adf598fd780cb8ca5fd1110028679828436ac3bc8a4335ca54c7a481aeaa7dc85938d0a4
7
- data.tar.gz: 5d10c755bb71d7ace592e33c5fa8b2c4a2d9a349805870914ca0c9ac3410306765324211820c1283c8c2d8846ddbbcf5d1c88f89f2d5b89899f554a6e5c187dd
6
+ metadata.gz: 86325f95bb29b0b739fa9104f3be207bd275df083a9a778bde7c941b405a6579fba8a7bff5a36bc121ef18f2ca64de9fb3716b12307b2a6ba84c24743c72dafc
7
+ data.tar.gz: 56fcb244c3a59405c738a0a5bf33b3a98d2a44f12d76fe129b745331de69625c13bf23537eb826df5ee00115c6bf02bb2fea81ff0f51622eb2f33faa1a34bd9c
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Specwrk
4
- VERSION = "0.16.0"
4
+ VERSION = "0.16.1"
5
5
  end
@@ -8,6 +8,8 @@ module Specwrk
8
8
  class Web
9
9
  module Endpoints
10
10
  class Base
11
+ MUTEX = Mutex.new
12
+
11
13
  attr_reader :started_at
12
14
 
13
15
  def initialize(request)
@@ -134,7 +136,17 @@ module Specwrk
134
136
  if skip_lock
135
137
  yield
136
138
  else
137
- Store.with_lock(URI(ENV.fetch("SPECWRK_SRV_STORE_URI", "memory:///")), run_id) { yield }
139
+ with_mutex do
140
+ Store.with_lock(URI(ENV.fetch("SPECWRK_SRV_STORE_URI", "memory:///")), run_id) { yield }
141
+ end
142
+ end
143
+ end
144
+
145
+ def with_mutex
146
+ if Thread.current == Thread.main
147
+ yield
148
+ else
149
+ MUTEX.synchronize { yield }
138
150
  end
139
151
  end
140
152
  end
@@ -70,6 +70,7 @@ module Specwrk
70
70
 
71
71
  def execute
72
72
  executor.run next_examples
73
+ @next_examples = nil
73
74
  complete_examples
74
75
  rescue UnhandledResponseError => e
75
76
  # If fetching examples via next_exampels fails we can just try again so warn and return
@@ -98,7 +99,7 @@ module Specwrk
98
99
  sleep 10
99
100
 
100
101
  begin
101
- client.heartbeat if client.last_request_at.nil? || client.last_request_at < Time.now - 30
102
+ client.heartbeat if client.last_request_at.nil? || client.last_request_at < Time.now - 9
102
103
  rescue
103
104
  warn "Heartbeat failed!"
104
105
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specwrk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Westendorf