Skip to content

Some test_upgrade fixes#726

Merged
OddBloke merged 2 commits into
canonical:masterfrom
TheRealFalcon:fix-upgrade
Dec 15, 2020
Merged

Some test_upgrade fixes#726
OddBloke merged 2 commits into
canonical:masterfrom
TheRealFalcon:fix-upgrade

Conversation

@TheRealFalcon
Copy link
Copy Markdown
Contributor

Proposed Commit Message

Some test_upgrade fixes

  • workaround pad.lv/1890528 for restarting instances
  • move wait param from launch_kwargs to launch call
  • remove name param as it's not universally supported
  • add platfrom to log names

Additional Context

n/a

Test Steps

pytest tests/integration_tests/test_upgrade.py

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

# Get the paths to write test logs
output_dir = Path(session_cloud.settings.LOCAL_LOG_PATH)
output_dir.mkdir(parents=True, exist_ok=True)
base_filename = 'test_upgrade_{os}_{{stage}}_{time}.log'.format(
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.

Is there an issue/etc for this change? Was the filename always wrong?

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's the output log of the running test. It outputs some of the same commands before and after the upgrade and writes the output to before and after log files. When running tests in batch, getting a number of log files like:

test_upgrade_gce_focal_before_1.log
test_upgrade_ec2_focal_before_2.log
test_upgrade_lxd_focal_before_3.log

is much preferable to

test_upgrade_focal_before_1.log
test_upgrade_focal_before_2.log
test_upgrade_focal_before_3.log

Copy link
Copy Markdown
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

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

One nit inline, but otherwise this looks good, thanks!

Comment thread tests/integration_tests/test_upgrade.py Outdated


def _restart(instance):
# work around pad.lv/1890528
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you explain in a little more detail how this is doing that? My reading of that bug is that it only triggers if cloud-init status --wait exits non-zero: if that's exiting non-zero (and therefore raising the OSError, I assume?) then result.ok in the for loop below is never going to be True, so we'll never return early. What am I missing?

(Even if I'm not missing something and this is a bug, this doesn't need to block landing; we should fix it soon hereafter though.)

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.

Hmmm, maybe this is a different bug then. On ec2, cloud-init returns early with non-zero status (I'm inferring this from pycloudlib behavior). Connecting again, it'll complete and return 0. Nothing in the logs or result.json or status.json indicate any sort of failure or problem anywhere.

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.

I'll file a separate bug with logs and update the reference here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

- workaround pad.lv/1890528 for restarting instances
- move wait param from launch_kwargs to launch call
- remove name param as it's not universally supported
- add platfrom to log names
@OddBloke OddBloke merged commit ca49e27 into canonical:master Dec 15, 2020
@TheRealFalcon TheRealFalcon deleted the fix-upgrade branch June 29, 2021 19:00
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.

3 participants