DescriptionDon't do "no instances found" after bootstrap.
Fix for bug 1208504 (apparently only seen for HP Cloud?)
Adding the fix on its own would have been trivial, but writing a failing test
required some refactoring... and while there, I've tried to simplify the code,
making some assumptions a little more explicit.
Notes:
* I can't reproduce this on trunk with canonistack, and I don't have an
HPCould account to verify the problem and solution. That said,
looking at the code for environs.StateInfo, it would cause described behaviour
error in its current form.
* I've added the 'broken-error' to the dummy environ config, which seems less than
ideal. I added it there because the "broken" config option was already there,
but I wonder if they'd both be best outside of the config itself (or is the
"broken" option used outside of the unit-tests?). The result is that
broken-error uses schema.Any. Another option would be to use string and change
the WaitForInstances conditional to be dependent on the error message rather than the
error, but that'd be even less ideal IMO?
* Currently in trunk, Environs.StateInfo returns with only the info from the first
available state instance (well, instances from the first successful call to
getDNSNames). Is this intended as the desired functionality, or for other reasons
(maybe historically there was only one state instance? I can't see any code
refering to more than one state instance). Anyway, I've made this more
explicit, but would be happy to update s/WaitForFirstDNSName/WaitForDNSNames/
if that would now be better functionality?
* In the refactored StateInfo function, I'm re-using the one timer
(LongAttempt) to keep the existing functionality (ie. waiting for both the
instances and then the dns(s) happens all within one LongAttempt). But that
requires two calls to .Next(), whereas the impatientStrategy test double only
allowed one. I've updated impatientStrategy as the simplest option, but if
that's not wanted, there are other ways around (ie. Adding an
Attempt.Remaining() that returns a new attempt based on the existing but with
the remaining counts/time).
https://code.launchpad.net/~michael.nelson/juju-core/1208504-post-bootstrap-hp-no-instances-found/+merge/179680
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : Don't do "no instances found" after bootstrap. #Patch Set 3 : Don't do "no instances found" after bootstrap. #Patch Set 4 : Don't do "no instances found" after bootstrap. #
MessagesTotal messages: 2
|