Plots2: reduce intermittent Travis test failures doing math properly with Time

Created on 16 Sep 2020  路  8Comments  路  Source: publiclab/plots2

@VladimirMikulic noted:

@cesswairimu The line 12 of tag_selection unit test fails.
https://github.com/publiclab/plots2/blob/master/test/unit/tag_selection_test.rb

In the test file, we are doing math with "times". If not done properly, this usually results in unstable tests.
Can we rewrite this test to preserve the functionality, but without "time" hacking?
@Tlazypanda your view on this?

@Tlazypanda noted:

@VladimirMikulic @cesswairimu Umm..going through this found these links might be helpful ...can you check it out? Thanks 鉁岋笍
https://www.greyblake.com/blog/2018-02-19-how-to-fix-intermittent-test-failures/
https://github.com/travisjeffery/timecop

I agree -- let's review this test and see if we can get our Travis tests to more consistently pass!

https://github.com/publiclab/plots2/blob/60cdd8f3a45f6824cde7484bc261d31df6e10dbd/test/unit/tag_selection_test.rb#L5-L14

We'd love help with this!

help wanted testing

Most helpful comment

Hey @jywarren just noting here that I had added the timecop test and it failed on Travis and on research I found out the reason to be :sweat_smile: -
https://github.com/publiclab/plots2/issues/7315#issuecomment-670795021

Might solve this problem for once and for all tagging @VladimirMikulic @Uzay-G

All 8 comments

Hey @jywarren just noting here that I had added the timecop test and it failed on Travis and on research I found out the reason to be :sweat_smile: -
https://github.com/publiclab/plots2/issues/7315#issuecomment-670795021

Might solve this problem for once and for all tagging @VladimirMikulic @Uzay-G

It would help if we knew _exactly_ how to reproduce the issue. Locally the test doesn't fail. So maybe some Travis settings affects it?

Lets keep this open as we monitor #8411 for the the next week or so

Thanks all! Much appreciated!

Noting that this has re-appeared again :facepalm:
` FAIL["test_graph", #<Minitest::Reporters::Suite:0x000000000762dc28 @name="TagSelectionTest">, 0.4174930689999883] test_graph#TagSelectionTest (0.42s) Expected: 16 Actual: 20 test/unit/tag_selection_test.rb:14:in `block in <class:TagSelectionTest>' 321/321: [===============================] 100% Time: 00:00:18, Time: 00:00:18

Keeping this open as we monitor https://github.com/publiclab/plots2/pull/8774 for a while

That fix looks awesome!!

I believe this is actually part of #8865 and should be solved there! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

first-timers[bot] picture first-timers[bot]  路  3Comments

milaaraujo picture milaaraujo  路  3Comments

jywarren picture jywarren  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments