-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve 'double' async loop issue with get_app_ips()
Bug [1] indicated a fault in the logic for get_app_ips() where the code went sync -> async -> sync -> async and thus ended up trying to reuse the same event loop.
- Loading branch information
1 parent
1e926f5
commit c510eb4
Showing
7 changed files
with
63 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ applications: | |
num_units: 2 | ||
ubuntu: | ||
charm: cs:ubuntu | ||
num_units: 1 | ||
num_units: 3 |
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 |
---|---|---|
|
@@ -9,4 +9,4 @@ applications: | |
num_units: 2 | ||
ubuntu: | ||
charm: cs:ubuntu | ||
num_units: 1 | ||
num_units: 3 |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2022 Canonical Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Collection of regression tests checking zaza/libjuju integration.""" | ||
|
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,42 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright 2018 Canonical Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Test regression libjuju / zaza integration.""" | ||
|
||
import logging | ||
import unittest | ||
|
||
import zaza.model | ||
|
||
|
||
class RegressionTest(unittest.TestCase): | ||
"""Regression Tests.""" | ||
|
||
def test_get_unit_public_address(self): | ||
"""Verify get_unit_public_address().""" | ||
logging.info('Verify that get_unit_public_address() function works.') | ||
units = zaza.model.get_units('ubuntu') | ||
ips = [zaza.model.get_unit_public_address(unit) for unit in units] | ||
for ip in ips: | ||
self.assertIsNotNone(ip) | ||
|
||
def test_get_app_ips(self): | ||
"""Verify that get_app_ips() doesn't invoke to async loops.""" | ||
logging.info('Verify that get_app_ips() works.') | ||
ips = zaza.model.get_app_ips('ubuntu') | ||
for ip in ips: | ||
self.assertIsNotNone(ip) | ||
|
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