Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Fix TextEditorPresenter spec timeout. - #10792

Merged
joshaber merged 11 commits into
masterfrom
fix-test-timeout
Feb 12, 2016
Merged

joshaber merged 11 commits into
masterfrom
fix-test-timeout

Conversation

@joshaber

Copy link
Copy Markdown
Contributor

Fixes #10435.

I haven’t been able to reproduce this locally yet, but let’s see if it’s as easy as giving it a longer timeout.

@joshaber

Copy link
Copy Markdown
Contributor Author

A parallel atom build failed: https://janky.githubapp.com/2759555/output

This kinda seems like a legit race.

@joshaber joshaber changed the title [WIP] Fix TextEditorPresenter spec timeout. Fix TextEditorPresenter spec timeout. Feb 12, 2016
@joshaber

Copy link
Copy Markdown
Contributor Author

This is ready.

The problem was with waitsForStateToUpdate. We'd call a function that emitted a state update, and then start watching for state updates. So we were racing between emitting the event and watching for it.

I introduced waitsForStateToUpdateAsync instead of fixing waitsForStateToUpdate, because when I changed waitsForStateToUpdate it broke some other tests which I didn't understand.

/cc @as-cii @nathansobo 👀 I think you two did most of the work here.

Comment thread spec/text-editor-presenter-spec.coffee Outdated

buffer = new TextBuffer(filePath: require.resolve('./fixtures/sample.js'))
editor = atom.workspace.buildTextEditor({buffer})
editor.setUpdatedSynchronously(true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interested in why this was needed...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't needed, but it made the test failures deterministic so I could ensure it was fixed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, do you think we could drop it now then? I feel like the test is more realistic overall without it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nathansobo

Copy link
Copy Markdown
Contributor

Thanks for this. Would be nice to only have one waitsForStateToUpdate method, but I'd rather fix the flakiness and get back to it later I suppose.

@joshaber

Copy link
Copy Markdown
Contributor Author

Would be nice to only have one waitsForStateToUpdate method, but I'd rather fix the flakiness and get back to it later I suppose.

Yeah, I agree. I time boxed this so I could get to some of the more pressing FR issues. Maybe the next FR could dig into this further.

@nathansobo

Copy link
Copy Markdown
Contributor

Yeah, I agree. I time boxed this so I could get to some of the more pressing FR issues. Maybe the next FR could dig into this further.

Totally reasonable.

@joshaber

Copy link
Copy Markdown
Contributor Author

We're back down to one waitsForStateToUpdate now 🤘

@nathansobo

Copy link
Copy Markdown
Contributor

We're back down to one waitsForStateToUpdate now 🤘

🙏 Namaste

joshaber added a commit that referenced this pull request Feb 12, 2016
Fix TextEditorPresenter spec timeout.
@joshaber
joshaber merged commit 9e073d8 into master Feb 12, 2016
@joshaber
joshaber deleted the fix-test-timeout branch February 12, 2016 22:24
@maxbrunsfeld

Copy link
Copy Markdown
Contributor

💰 🚋 💵 🚂!!

@as-cii

as-cii commented Feb 15, 2016

Copy link
Copy Markdown
Contributor

Thank you, @joshaber! 💥

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants