Friday, 26 May 2017

Ruby's Thread#exit not exiting the current thread in Travis

I'm working on a school project in Node.js, for which we (my teammate and myself) added a bunch of integration tests ran by a Ruby script. As mentionned in the title, we use Travis to run this test at each push.

We work on a decentralised application, requiring us to start 3 servers for our tests to run. To do so, we start each server in a thread, and once all servers have started, we run the tests (using Postman's newman CLI) in one of the three threads (the one for which the server was the longest to start).

Exiting the script after the tests ran means stopping the servers and exiting their threads. To do so, I'm killing every server's process and exiting all of their threads, ending with the thread running the tests.

Unfortunately, this same thread always fails to exit, causing the Travis build to timeout and get into the errored state. Which is weird, as it all works nicely on my laptop.

The Ruby script's available on GitHub here: https://github.com/JosephCaillet/vinimay/blob/friends/run_tests.rb

Why is Travis failing to exit my thread and how can I fix it?



via Brendan Abolivier

No comments:

Post a Comment