This repository has been archived by the owner. It is now read-only.

Fix flaky test re: "changes the line endings in the buffer" 馃 #57

Merged
merged 1 commit into from May 18, 2018

Conversation

Projects
None yet
2 participants
@jasonrudolph
Member

jasonrudolph commented May 17, 2018

We've seen a few instances of the CI failure described in atom/atom#17326, but I haven't been able to reproduce it locally. 馃槗 However, I've reviewed the first test referenced in that CI failure, and I think I see the potential cause of the failure.

Currently, the test changes the line ending for a file, then registers a change observer, and then waits for the change observer to be called. Since we aren't registering the change observer until after we change the line endings, I suspect that could lead to us waiting forever for our change observer to get called, thus leading to a failure like the timeout that we're seeing.

To make sure the observer gets called when the line endings change, this pull request registers the observer before changing the line endings, then changes the line endings, and then waits until the observer has been called.

Set up change observer _before_ performing change
Prior to this change, the test changed the line ending for a file,
_then_ registered a change observer, and then waited for the change
observer to be called. We're seeing some flakiness with this test
(atom/atom#17326), and I think this order of
operations might be the cause of the flakiness.

To make sure we observer gets called when the line endings change, let's
register the observer _before_ changing the line endings.

@jasonrudolph jasonrudolph requested a review from maxbrunsfeld May 17, 2018

@maxbrunsfeld

鈿★笍

@jasonrudolph jasonrudolph merged commit 5557ee0 into master May 18, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jasonrudolph jasonrudolph deleted the fix-atom-17326 branch May 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.