kittoframework / kitto

Kitto is a framework for interactive dashboards written in Elixir
http://kitto.io/dashboards/sample
MIT License
956 stars 58 forks source link

Fixes failing Travis test #113

Closed davejlong closed 5 years ago

davejlong commented 7 years ago

The test is simply to say that a job gets run more than once. The new test asserts this by letting the job run for 1 seconds and ensures that within that second the job has run more than once.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 88.732% when pulling 70b9354c4da6e0808bc2c730e7773aa2d78bdea4 on travis-fixes into 5061f58ca2d9520e9957078dda4da4d5f1b8ad66 on master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 88.732% when pulling 70b9354c4da6e0808bc2c730e7773aa2d78bdea4 on travis-fixes into 5061f58ca2d9520e9957078dda4da4d5f1b8ad66 on master.

davejlong commented 7 years ago

Looking at the failing test, it's around testing time and is breaking because we are making assumptions about how long code takes to run. It's going to work locally on our PCs dedicated to running these tests, but will fail on shared systems like those that Travis CI uses. Is there a better way for us to test time without needed to assume how long code will take to run? Perhaps if we could look at system time instead of user time...

zorbash commented 7 years ago

@davejlong There's a better way to test this. Instead of inspecting the process mailbox directly, we should wait for the job to be called n times (for a given n) and then then assert_in_delta that the system time difference is n times the interval. What do you think?

davejlong commented 7 years ago

The issue with checking the time is that Erlang's :timer.tc is gives user time instead of system time so we'll probably always see different environments, especially ones with really long wait times like Travis, give pretty widely varying results.

On Tue, Jun 13, 2017, 5:05 PM Dimitrios Zorbas notifications@github.com wrote:

@davejlong https://github.com/davejlong There's a better way to test this. Instead of inspecting the process mailbox directly, we should wait for the job to be called n times (for a given n) and then then assert_in_delta that the system time difference is n times the interval. What do you think?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/kittoframework/kitto/pull/113#issuecomment-308248434, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKs1YOCyUF_rAi5NpyJUvHnXWazODGJks5sDvmogaJpZM4N2ORQ .