Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Wait for asset discovery finish when awaiting on snapshot resources in finalize #423

Merged
merged 6 commits into from
Nov 22, 2019

Conversation

Robdel12
Copy link
Contributor

@Robdel12 Robdel12 commented Nov 21, 2019

What is this?

The title is a mouthful, that's for sure. If the child process spawned by agent in exec exits while snapshots are processing, it's possible for snapshots to be added to a finalizing build. This will break the rendering pipeline for that build.

Approach

First up was to write an acceptance test that reproduces this behavior. The easiest way would be to have a PercyScript file that loops through snapshots and throws an exception while taking snapshots. Then assert to make sure no snapshots were added to to the build after we've finalized the build.

Quick solution: As soon as handleSnaphshot is called, add a promise to the snapshotCreationPromises array. That way any deferred work can still be awaited on (when we're stopping agent).

Better (future) solution: After finalize is called for a build, no more snapshot or resource requests should be uploaded. This might require more of a sweeping change to how services are interconnected yet decoupled from command classes.

TODOs

  • Assert on waiting for x snapshots stdout
  • Investigate integration test issues

@Robdel12 Robdel12 marked this pull request as ready for review November 21, 2019 23:28
test/acceptance/asset-discovery.test.js Outdated Show resolved Hide resolved
test/acceptance/asset-discovery.test.js Outdated Show resolved Hide resolved
test/acceptance/asset-discovery.test.js Outdated Show resolved Hide resolved
test/acceptance/helpers/proxy.js Outdated Show resolved Hide resolved
Copy link
Contributor

@wwilsman wwilsman left a comment

Choose a reason for hiding this comment

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

🎮

@Robdel12 Robdel12 merged commit 4a6deea into master Nov 22, 2019
@delete-merged-branch delete-merged-branch bot deleted the rd/await-for-asset-discovery branch November 22, 2019 00:04
djones pushed a commit that referenced this pull request Nov 22, 2019
## [0.20.2](v0.20.1...v0.20.2) (2019-11-22)

### Bug Fixes

* Wait for asset discovery finish when awaiting on snapshot resources in finalize ([#423](#423)) ([4a6deea](4a6deea))
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.

None yet

2 participants