Comments (7)
Looks like this issue is flaky. 😟
I'm going to leave this open and stop commenting.
A human should fix and close this.
When run at the same commit (e6063de), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).
from python-monitoring.
hey @arithmetic1728 , similar to #150 it seems like there is also a discrepancy between pochan.alert_policy.display_name
from the test and [(policy.name, policy.display_name) for policy in policies]
from the client seems to differ from time to time, causing these flaky tests. Please help take a look!
from python-monitoring.
Oops! Looks like this issue is still flaky. It failed again. 😬
I reopened the issue, but a human will need to close it again.
commit: cd1300d
buildURL: Build Status, Sponge
status: failed
Test output
capsys = <_pytest.capture.CaptureFixture object at 0x7f777e2f0e80> pochan =def test_list_alert_policies(capsys, pochan): snippets.list_alert_policies(pochan.project_name) out, _ = capsys.readouterr() # Only check up to the first 20 characters of the display name # as long strings printed to the console are truncated.
assert pochan.alert_policy.display_name[0:20] in out
E AssertionError: assert 'snippets-test-mokaqz' in 'name display_name\n---------------------------...est-tigjdnakwf\nprojects/python-docs-samples-tests-py36/alertPolicies/7501165308929258283 snippets-test-beidgwacze\n'
snippets_test.py:130: AssertionError
from python-monitoring.
parthea commented on June 10, 2024 I was only able to re-create this issue by modifying test_list_alert_policies() to list a newly created alert policy.
def test_list_alert_policies(capsys, pochan): # Create a new alert policy json = open("test_alert_policy.json").read() policy = monitoring_v3.AlertPolicy.from_json(json) policy.display_name = "snippets-test-" + random_name(10) pochan.alert_policy = pochan.alert_policy_client.create_alert_policy( name=pochan.project_name, alert_policy=policy ) # List alert policies and look for the policy we just created snippets.list_alert_policies(pochan.project_name) out, _ = capsys.readouterr() # Only check up to the first 20 characters of the display name # as long strings printed to the console are truncated. assert pochan.alert_policy.display_name[0:20] in out
The above test fails locally. Adding a retry fixed the issue. See below:
def test_list_alert_policies(capsys, pochan): # Create a new alert policy json = open("test_alert_policy.json").read() policy = monitoring_v3.AlertPolicy.from_json(json) policy.display_name = "snippets-test-" + random_name(10) pochan.alert_policy = pochan.alert_policy_client.create_alert_policy( name=pochan.project_name, alert_policy=policy ) # List alert policies and look for the policy we just created. # Query snippets.list_alert_policies() for up to 5 seconds # to allow the newly created policy to appear in the list. retry = 5 while retry: snippets.list_alert_policies(pochan.project_name) out, _ = capsys.readouterr() # Only check up to the first 20 characters of the display name # as long strings printed to the console are truncated. if pochan.alert_policy.display_name[0:20] in out: break retry = retry - 1 time.sleep(1) assert retry > 0
from python-monitoring.
flaky-bot commented on June 10, 2024 Oops! Looks like this issue is still flaky. It failed again. 😬
I reopened the issue, but a human will need to close it again.
commit: 064f1e0
buildURL: Build Status, Sponge
status: failedTest output
capsys = <_pytest.capture.CaptureFixture object at 0x7f2bd54d7b90> pochan =def test_list_alert_policies(capsys, pochan): snippets.list_alert_policies(pochan.project_name) out, _ = capsys.readouterr() # Only check up to the first 20 characters of the display name # as long strings printed to the console are truncated.
assert pochan.alert_policy.display_name[0:20] in out
E AssertionError: assert 'snippets-test-wcujif' in 'name display_name\n---------------------------...est-xvqznroeih\nprojects/python-docs-samples-tests-py37/alertPolicies/2404774893716709115 snippets-test-tofvuduanj\n'
snippets_test.py:130: AssertionError
from python-monitoring.
flaky-bot commented on June 10, 2024 Oops! Looks like this issue is still flaky. It failed again. 😬
I reopened the issue, but a human will need to close it again.
commit: a942b31
buildURL: Build Status, Sponge
status: failedTest output
capsys = <_pytest.capture.CaptureFixture object at 0x7f50cd227e10> pochan =def test_list_alert_policies(capsys, pochan): snippets.list_alert_policies(pochan.project_name) out, _ = capsys.readouterr() # Only check up to the first 20 characters of the display name # as long strings printed to the console are truncated.
assert pochan.alert_policy.display_name[0:20] in out
E AssertionError: assert 'snippets-test-xshkan' in 'name display_name\n---------------------------...est-tigjdnakwf\nprojects/python-docs-samples-tests-py36/alertPolicies/7501165308929258283 snippets-test-beidgwacze\n'
snippets_test.py:130: AssertionError
from python-monitoring.
parthea commented on June 10, 2024 This should be resolved with #170
from python-monitoring.
Related Issues (20)
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed
- tests.unit.gapic.monitoring_v3.test_service_monitoring_service: test_list_service_level_objectives_pager failed HOT 1
- tests.unit.gapic.monitoring_v3.test_service_monitoring_service: test_list_service_level_objectives_async_pager failed HOT 4
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 1
- tests.unit.gapic.monitoring_v3.test_service_monitoring_service: test_list_service_level_objectives_async_pager failed HOT 3
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 4
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_async_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_async_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 5
- Warning: a recent release failed HOT 1
- Accidentally definition of interval in snippets.py in v3/cloud-client HOT 2
- MQL query returning empty with QueryTimeSeriesRequest HOT 6
- In python 3.11.0 monitoring_v3 import is failing HOT 7
- UptimeCheckServiceClient.list_uptime_check_ips() returns unrecognized UptimeCheckRegion enum value HOT 1
Recommend Projects
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
TensorFlow
An Open Source Machine Learning Framework for Everyone
Django
The Web framework for perfectionists with deadlines.
Laravel
A PHP framework for web artisans
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
web
Some thing interesting about web. New door for the world.
server
A server is a program made to process requests and deliver data to clients.
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Visualization
Some thing interesting about visualization, use data art
Game
Some thing interesting about game, make everyone happy.
Recommend Org
We are working to build community through open source technology. NB: members must have two-factor auth.
Microsoft
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba
Alibaba Open Source for everyone
D3
Data-Driven Documents codes.
Tencent
China tencent open source team.
Jobs
Jooble
from python-monitoring.