migrations: ensure units have relation scopes in precheck #8018

Merged
merged 2 commits into from Nov 3, 2017

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Nov 2, 2017

Description of change

We were seeing CI migration tests fail because the migration was being
started before subordinate units had entered their relation's scope. Add
a precheck for this situation so that the user can see that they need to
wait for the units to finish coming up (rather than the migration
aborting for a cryptic reason).

QA steps

Bootstrap 2 controllers A and B.
Create model m in A.
Deploy ubuntu and ntp to m but don't relate them immediately.
Once the ubuntu unit is fully ready and idle, relate ntp and ubuntu, and immediately start repeatedly trying to migrate m to B.
You'll see a variety of pre-migration check errors, including:
ERROR source prechecks failed: unit ntp/0 hasn't joined relation ntp:ntp-peers yet
Eventually the unit will be ready and the migration will run successfully.

Bug reference

Example of failed test run:
http://qa.jujucharms.com/releases/5851/job/model-migration-lxd/attempt/2111

babbageclunk added some commits Nov 2, 2017

migrations: Check that units have relation scopes
We were seeing CI migration tests fail because the migration was being
started before subordinate units had entered their relation's scope. Add
a precheck for this situation so that the user can see that they need to
wait for the units to finish coming up (rather than the migration
aborting for a cryptic reason).
Member

babbageclunk commented Nov 2, 2017

This will mean that the test will still sometimes fail (although with the precheck error, rather than a generic "migraton aborted" error and a message about the relation scope in the logs). Once this is landed and has seen a test run I'll change the test to wait for the agents to be ready (it already waits for the application and workloads to be ready).

Member

babbageclunk commented Nov 3, 2017

$$merge$$

Contributor

jujubot commented Nov 3, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit 5b70deb into juju:develop Nov 3, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@babbageclunk babbageclunk deleted the babbageclunk:relationscope-precheck branch Nov 3, 2017

babbageclunk added a commit to babbageclunk/juju that referenced this pull request Nov 14, 2017

Don't start migration until unit agents are idle
We were seeing failures because a migration would be started before
subordinate units had entered scope - this meant that the export would
fail. The migration source prechecks were updated to make the failure
occur earlier (juju#8018), but this test
also needs to be updated to wait for the unit agents to be finished,
otherwise it will fail because of the precheck.

An example:
http://qa.jujucharms.com/releases/5924/job/model-migration-lxd/attempt/2234

jujubot added a commit that referenced this pull request Nov 15, 2017

Merge pull request #8073 from babbageclunk/migration-precheck-test-fix
acceptancetests: Don't start migration until unit agents are idle

## Description of change

We were seeing failures because a migration would be started before
subordinate units had entered scope - this meant that the export would
fail. The migration source prechecks were updated to make the failure
occur earlier (#8018), but this test
also needs to be updated to wait for the unit agents to be finished,
otherwise it will sometimes fail because of the precheck.

An example failure:
http://qa.jujucharms.com/releases/5924/job/model-migration-lxd/attempt/2234

Includes a driveby fix for a go vet error.

## QA steps

Run the acceptance test (ideally multiple times), ensure that it doesn't fail with 
the migration precheck error.

nskaggs added a commit to nskaggs/juju that referenced this pull request Nov 15, 2017

Don't start migration until unit agents are idle
We were seeing failures because a migration would be started before
subordinate units had entered scope - this meant that the export would
fail. The migration source prechecks were updated to make the failure
occur earlier (juju#8018), but this test
also needs to be updated to wait for the unit agents to be finished,
otherwise it will fail because of the precheck.

An example:
http://qa.jujucharms.com/releases/5924/job/model-migration-lxd/attempt/2234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment