Skip to content

Conversation

@mtyaka
Copy link
Member

@mtyaka mtyaka commented Nov 17, 2015

This PR tries to fix the situation with flaky tests by:

  • making a recently introduced flaky test (test_scroll_into_view) more robust by increasing the scroll check tolerance,
  • enabling Circle CI builds in parallel mode (tests finish in 12-15 minutes compared to >30 minutes on Travis CI where they are not parallelized.
  • Suppressing benign "broken pipe" errors that were polluting the logs. These errors are suppressed by default in django 1.8 (https://code.djangoproject.com/ticket/4444)
  • Sleep before reloading xblock from the database in one of the flaky tests (test_author_changes). The block was reloaded immediately after the browser page was loaded in selenium. Selenium blocks while the page is loading, but it doesn't block on any ajax requests that happen after page load. The mentoring xblock requests some data at page load time via ajax (initXBlockView), which was probably causing a race condition where both the ajax request and the reload_pb_block test helper method were trying to get_or_create block instance data at the same time. Unfortunately I wasn't able to prove this, but the MultipleObjectsReturned hasn't occurred since this change.

The scrolling is not entirely precise, it's sometimes off by a pixel or two.
Increase the tolerance to 2 pixels.
We would often see 'Broken pipe' errors pulluting the logs when running tests.
Broken pipe errors occur when browser aborts connection. It can be because
the browser was navigated to a different url before the current page finished
loading, but it could also be because it started downloading an image, but decided
that the image didn't change after loading part of it, and aborts the connection
to use the version from the cache.

The broken pipe errors are benign and are actually suppressed by default in Django 1.8.
@mtyaka mtyaka force-pushed the headandshoulders branch 5 times, most recently from edcd0f5 to 98573c3 Compare November 18, 2015 13:47
@mtyaka mtyaka changed the title WIP: Fix flaky tests Fix flaky tests Nov 19, 2015
See code comment for more info. Unfortunately, I wasn't able
to find anything better than time.sleep().
@bradenmacdonald
Copy link
Member

Can you switch the build status graphic in README.md to Circle CI, and remove travis.yml? Or is there some reason for keeping it around?

@mtyaka
Copy link
Member Author

mtyaka commented Nov 20, 2015

@bradenmacdonald I switched the graphic and removed travis.yml, I don't think there's any reason to keep it.

@bradenmacdonald
Copy link
Member

@mtyaka Great :)

If you remove the old is_broken_pipe_error that you accidentally left in, this is 👍

mtyaka added a commit that referenced this pull request Nov 20, 2015
@mtyaka mtyaka merged commit 67d7563 into master Nov 20, 2015
@xitij2000 xitij2000 deleted the headandshoulders branch December 13, 2019 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants