Plots2: Fix travis failing tests

Created on 21 Jan 2020  路  17Comments  路  Source: publiclab/plots2

Whenever a test fails in Travis that passes after restarting travis report here. We can try and discuss possible fixes and hopefully solve all these issues .

bug discussion testing

Most helpful comment

Hey @jywarren just noting here that tag_selection_testissue has been resolved in #8168 :v:

All 17 comments

@Uzay-G @cesswairimu @VladimirMikulic is it fixed now?

Yes, it is :)

We still have some tests that fail and pass during restart...forgot to update the one I saw yesterday here. I will keep this one open for now. Thanks

Which one was it? Thanks.

Found one

ERROR["test_removing_tags_from_the_post", #<Minitest::Reporters::Suite:0x00007fe6aa99a050 @name="PostTest">, 52.56339576299996]
 test_removing_tags_from_the_post#PostTest (52.56s)
Minitest::UnexpectedError:         Mysql2::Error: 
            app/controllers/tag_controller.rb:396:in `delete'

Oh, it's that one? Unfortunately, only admins can fix it. It's the DB connections problems, not the test ones :)

oh cool, I will take a look

 Listening on tcp://127.0.0.1:37547
[Screenshot]: tmp/screenshots/failures_test_changing_and_reverting_versions_works_correctly_for_wiki.png
 FAIL["test_changing_and_reverting_versions_works_correctly_for_wiki", #<Minitest::Reporters::Suite:0x00007fbef1726160 @name="PostTest">, 16.051510167999993]
 test_changing_and_reverting_versions_works_correctly_for_wiki#PostTest (16.05s)
        Expected false to be truthy.
        test/system/post_test.rb:157:in `block in <class:PostTest>'

Now we seem to be having just very slow Travis tests, but not as many failures. Just an observation!

https://github.com/publiclab/plots2/pull/7996 and several others are showing a repeated unit test failure (inconsistently) due to tag_selection -- I wonder if it's a timing inconsistency? It's so odd when tests pass only sometimes.

For some timing non-deterministic issues, we can use Timecop to freeze the internal Ruby clock. This is done on some other tests. I wonder if it is worth trying this, and/or researching where and why we used Timecop on past test inconsistencies and whether this seems like a similar one. @Tlazypanda would you have any time to try looking into this? It's fine if not, and I can help out, but it's a bit of an interesting issue that can come up in testing, so i dunno if you're into it at all?

Thanks, all!

Yeah sure will take a look into this :tada: Looping in @VladimirMikulic as well since he has some experience with this :sweat_smile:

Thanks, @Tlazypanda. tag_selection is a weird one. It always passes locally, but sometimes for no obvious reason fails in Travis.
Are you able to shine some light on this @Uzay-G? Thanks all.

Hey @jywarren just noting here that tag_selection_testissue has been resolved in #8168 :v:

OMGGGG 馃帀 馃帀 馃帀 馃帀 馃帀 馃帀 馃帀

Let's close this for now but re-open if this kind of thing happens again. Thank you so much, everyone and esp. @Tlazypanda and @cesswairimu !

Hey @jywarren @cesswairimu I just saw the tag_selection_test fail again :cry: I thought the timecop freeze should have fixed it but I am not sure why its failing again https://github.com/travisjeffery/timecop/issues/146 https://github.com/travisjeffery/timecop/issues/97#issuecomment-41294684 Seems like there are still some time dependency issues due to CI issues mentioned here in this comment maybe switch to Time.zone.now.change(nsec: 0) as mentioned here? Also once I do create a pr for this how would we able to check this repeatedly for CI so that we know this doesn't break?

Tagging @Uzay-G @VladimirMikulic for their feedback and help. Thanks everyone :raised_hands:

@Tlazypanda we could restart PR's CI multiple times to see if it does really work. Not a perfect way to measure but we'll get some insights at least.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ebarry picture ebarry  路  3Comments

bronwen9 picture bronwen9  路  3Comments

RuthNjeri picture RuthNjeri  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments