Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Include more information re "git repo not ready" #1171

Merged
merged 2 commits into from
Jul 2, 2018

Conversation

squaremo
Copy link
Member

@squaremo squaremo commented Jun 26, 2018

Setting up git can be quite fiddly. One thing that would make it easier to troubleshoot is if fluxd did a better job of logging why it hadn't cloned the git repo yet.

This commit introduces a struct for not-ready-errors, so they can include the underlying problem. Since we now expect there to be an underlying reason, create errors for "just haven't tried yet", and enforce the invariant of not ready -> has error.

Fixes #1170.

This commit introduces a struct for not-ready-errors, so they can
include the underlying problem. Since we now _expect_ there to be an
underlying reason, create errors for "just haven't tried yet", and
enforce the invariant of `not ready -> has error`.
@squaremo squaremo requested a review from aaron7 June 26, 2018 13:04
Lots of tests use the git mirroring, and have to wait for it to report
that it's ready before proceeding. We see this flake all the time, and
it seemed odd that it couldn't complete a git clone on the local
filesystem within five seconds.

The helper function was trying every 100ms, five times, but reporting
that it had tried for five seconds if it failed. Instead, try every
100ms, thirty times, and report accordingly.
@squaremo squaremo force-pushed the issue/1170-more-git-failure-info branch from 64a6b94 to ab6fc85 Compare June 26, 2018 16:20
Copy link
Contributor

@aaron7 aaron7 left a comment

Choose a reason for hiding this comment

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

lgtm. I don't suppose it's easy to write some automated tests for these flows?

@squaremo
Copy link
Member Author

squaremo commented Jul 2, 2018

I don't suppose it's easy to write some automated tests for these flows?

Fair question! Off the top of my head, it would be possible to set up various scenarios then make sure the git state machine arrived at the correct outcome. Slightly harder would be to check each transition, by stepping through a loop at a time.

@squaremo squaremo merged commit 659d9a0 into master Jul 2, 2018
@squaremo squaremo deleted the issue/1170-more-git-failure-info branch July 2, 2018 09:12
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.

2 participants