Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test: simplify test setup - return server
  • Loading branch information
kares committed Jan 25, 2022
commit deb903f17eb38a3013d1621ffde46f5c842e369b
23 changes: 10 additions & 13 deletions spec/outputs/http_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,18 @@ def self.retry_fail_count()
def sinatra_run_wait(app, opts)
queue = Queue.new

t = java.lang.Thread.new(
proc do
begin
app.run!(opts) do |server|
queue.push("started")
end
rescue => e
puts "Error in webserver thread #{e}"
# ignore
Thread.start do
begin
app.start!(opts) do |server|
queue.push(server)
end
rescue => e
warn "Error in webserver thread #{e}"
# ignore
end
)
t.daemon = true
t.start
queue.pop # blocks until the run! callback runs
end

queue.pop # blocks until the start! callback runs
end

config.before(:suite) do
Expand Down