-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from cderici/green-ci-cleanup
#939 #### Description There's a couple of known intermittent failures in CI, some excessive warning logs and asyncio outputs. This PR attempts to clear up some of these issues for the new release. Some major ones of the known CI failures are as follows (will be updated on the go) in the QA steps below. All the tests should be green before this lands. #### QA Steps ``` tox -e integration --tests/integration/test_model.py::test_add_and_list_storage ``` ``` tox -e integration -- tests/integration/test_controller.py::test_destroy_model_by_name ``` ``` tox -e integration -- tests/integration/test_controller.py::test_secrets_backend_lifecycle ``` ``` tox -e integration -- tests/integration/test_crossmodel.py::test_relate_with_offer ``` ``` tox -e integration -- tests/integration/test_model.py::test_deploy_bundle_local_charms ``` ``` tox -e integration -- tests/integration/test_model.py::test_deploy_bundle_local_charm_series_manifest ``` ``` tox -e integration -- tests/integration/test_connection.py::test_reconnect ``` All CI tests need to pass. Following examples should complete without any noise: ```sh $ python examples/connect_current_model.py ``` Also try to deliberately have it error. The error should only include the relevant parts, i.e. no clutter or noise from pending tasks etc. ```sh $ juju deploy ubuntu $ python examples/deploy.py Connecting to model Deploying ubuntu Disconnecting from model Traceback (most recent call last): ........... File "/home/caner/work/python-libjuju/juju/client/_client17.py", line 1051, in Deploy reply = await self.rpc(msg) File "/home/caner/work/python-libjuju/juju/client/facade.py", line 659, in rpc result = await self.connection.rpc(msg, encoder=TypeEncoder) File "/home/caner/work/python-libjuju/juju/client/connection.py", line 693, in rpc raise errors.JujuError(err_results) juju.errors.JujuError: ['cannot add application "ubuntu": application already exists'] ``` #### Notes & Discussion JUJU-4549
- Loading branch information
Showing
13 changed files
with
101 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
options: | ||
status: | ||
type: string | ||
default: "active" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
status="$(config-get status)" | ||
|
||
if [[ "$status" == "error" ]]; then | ||
if [[ -e .errored ]]; then | ||
status="active" | ||
else | ||
touch .errored | ||
exit 1 | ||
fi | ||
fi | ||
status-set "$status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bases: | ||
- architectures: | ||
- amd64 | ||
channel: '22.04' | ||
name: ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: assumes-charm | ||
summary: "test" | ||
description: "test" | ||
maintainers: ["test"] | ||
assumes: | ||
- juju | ||
- any-of: | ||
- all-of: | ||
- juju >= 2.9 | ||
- juju < 3 | ||
- all-of: | ||
- juju >= 3.1 | ||
- juju < 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,7 +205,7 @@ async def test_secrets_backend_lifecycle(event_loop): | |
# deploy postgresql | ||
await m.deploy('postgresql', base='[email protected]') | ||
# deploy vault | ||
await m.deploy("vault", base='ubuntu@20.04') | ||
await m.deploy("vault", channel='1.8/stable', base='ubuntu@22.04') | ||
# relate/integrate | ||
await m.integrate("vault:db", "postgresql:db") | ||
# wait for the postgresql app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
import string | ||
import time | ||
import uuid | ||
from concurrent.futures import ThreadPoolExecutor | ||
|
||
import mock | ||
import paramiko | ||
|
@@ -663,32 +662,6 @@ async def mock_AddRelation(*args, **kwargs): | |
assert isinstance(my_relation, Relation) | ||
|
||
|
||
async def _deploy_in_loop(new_loop, model_name, jujudata): | ||
new_model = Model(jujudata=jujudata) | ||
await new_model.connect(model_name) | ||
try: | ||
await new_model.deploy('ubuntu', channel='stable') | ||
assert 'ubuntu' in new_model.applications | ||
finally: | ||
await new_model.disconnect() | ||
|
||
|
||
@base.bootstrapped | ||
async def test_explicit_loop_threaded(event_loop): | ||
async with base.CleanModel() as model: | ||
model_name = model.name | ||
new_loop = jasyncio.new_event_loop() | ||
with ThreadPoolExecutor(1) as executor: | ||
f = executor.submit( | ||
new_loop.run_until_complete, | ||
_deploy_in_loop(new_loop, | ||
model_name, | ||
model._connector.jujudata)) | ||
f.result() | ||
await model._wait_for_new('application', 'ubuntu') | ||
assert 'ubuntu' in model.applications | ||
|
||
|
||
@base.bootstrapped | ||
async def test_store_resources_charm(event_loop): | ||
pytest.skip('Revise: test_store_resources_charm intermittent test failure') | ||
|
@@ -1086,7 +1059,7 @@ async def test_application_annotations(event_loop): | |
async def test_unit_annotations(event_loop): | ||
|
||
async with base.CleanModel() as model: | ||
app = await model.deploy('ubuntu', channel="stable") | ||
app = await model.deploy('ubuntu') | ||
await model.wait_for_idle() | ||
unit = app.units[0] | ||
|
||
|
@@ -1096,8 +1069,8 @@ async def test_unit_annotations(event_loop): | |
expected = {"foo": "bar", "another": "value"} | ||
await unit.set_annotations(expected) | ||
|
||
annotations = await unit.get_annotations() | ||
assert annotations == expected | ||
annotations_2 = await unit.get_annotations() | ||
assert annotations_2 == expected | ||
|
||
|
||
@base.bootstrapped | ||
|
@@ -1274,7 +1247,13 @@ async def test_detach_storage(event_loop): | |
async def test_add_and_list_storage(event_loop): | ||
async with base.CleanModel() as model: | ||
app = await model.deploy('postgresql', base='[email protected]') | ||
await model.wait_for_idle(status="active", timeout=900) | ||
# TODO (cderici): | ||
# This is a good use case for waiting on individual unit status | ||
# (i.e. not caring about the app status) | ||
# All we need is to make sure a unit is up, doesn't even need to | ||
# be in 'active' or 'idle', i.e. | ||
# await model.wait_for_idle(status="waiting", wait_for_exact_units=1) | ||
await jasyncio.sleep(5) | ||
unit = app.units[0] | ||
await unit.add_storage("pgdata", size=512) | ||
storages = await model.list_storage() | ||
|