Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix flask undefined client #1099

Merged
merged 1 commit into from
Apr 14, 2021
Merged

fix flask undefined client #1099

merged 1 commit into from
Apr 14, 2021

Conversation

DougDK
Copy link
Contributor

@DougDK DougDK commented Apr 14, 2021

What does this pull request do?

Fix the issue #1098 by allowing the "build the application on the fly" feature for flask agent. This also fix backward compatibility with old versions.

Related issues

closes #1098

@apmmachine
Copy link
Contributor

apmmachine commented Apr 14, 2021

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Started by user Benjamin Wohlwend

  • Start Time: 2021-04-14T06:42:35.550+0000

  • Duration: 20 min 2 sec

  • Commit: 89e1368

Test stats 🧪

Test Results
Failed 1
Passed 9685
Skipped 7883
Total 17569

Trends 🧪

Image of Build Times

Image of Tests

Test errors 1

Expand to view the tests failures

Initializing / Test / Python-pypy-3-1 / test_ssl_verify_fails – tests.transports.test_urllib3
    Expand to view the error details

     assert 'certificate verify failed' in '<ExceptionInfo TransportException("Unable to reach APM Server: HTTPSConnectionPool(host=\'127.0.0.1\', port=35633): M...or(SSLCertVerificationError(1, \'unable to get local issuer certificate\'))) (url: https://127.0.0.1:35633)") tblen=2>'
     +  where '<ExceptionInfo TransportException("Unable to reach APM Server: HTTPSConnectionPool(host=\'127.0.0.1\', port=35633): M...or(SSLCertVerificationError(1, \'unable to get local issuer certificate\'))) (url: https://127.0.0.1:35633)") tblen=2>' = str(<ExceptionInfo TransportException("Unable to reach APM Server: HTTPSConnectionPool(host='127.0.0.1', port=35633): Max ...Error(SSLCertVerificationError(1, 'unable to get local issuer certificate'))) (url: https://127.0.0.1:35633)") tblen=2>) 
    

    Expand to view the stacktrace

     waiting_httpsserver = <SecureContentServer(<class 'pytest_localserver.https.SecureContentServer'>, started 139674164442880)>
    elasticapm_client = <tests.fixtures.TempStoreClient object at 0x000000000aacf328>
    
        @pytest.mark.flaky(reruns=3)  # test is flaky on Windows
        def test_ssl_verify_fails(waiting_httpsserver, elasticapm_client):
            waiting_httpsserver.serve_content(code=202, content="", headers={"Location": "http://example.com/foo"})
            transport = Transport(waiting_httpsserver.url, client=elasticapm_client)
            transport.start_thread()
            try:
                with pytest.raises(TransportException) as exc_info:
                    url = transport.send(compat.b("x"))
    >           assert "certificate verify failed" in str(exc_info)
    E           assert 'certificate verify failed' in '<ExceptionInfo TransportException("Unable to reach APM Server: HTTPSConnectionPool(host=\'127.0.0.1\', port=35633): M...or(SSLCertVerificationError(1, \'unable to get local issuer certificate\'))) (url: https://127.0.0.1:35633)") tblen=2>'
    E            +  where '<ExceptionInfo TransportException("Unable to reach APM Server: HTTPSConnectionPool(host=\'127.0.0.1\', port=35633): M...or(SSLCertVerificationError(1, \'unable to get local issuer certificate\'))) (url: https://127.0.0.1:35633)") tblen=2>' = str(<ExceptionInfo TransportException("Unable to reach APM Server: HTTPSConnectionPool(host='127.0.0.1', port=35633): Max ...Error(SSLCertVerificationError(1, 'unable to get local issuer certificate'))) (url: https://127.0.0.1:35633)") tblen=2>)
    
    tests/transports/test_urllib3.py:171: AssertionError 
    

Steps errors 10

Expand to view the steps failures

Shell Script
  • Took 4 min 51 sec . View more details on here
  • Description: ./tests/scripts/docker/run_tests.sh pypy-3 none
Shell Script
  • Took 3 min 43 sec . View more details on here
  • Description: ./tests/scripts/docker/run_tests.sh pypy-3 none
Restore files previously stashed
  • Took 0 min 0 sec . View more details on here
  • Description: coverage-pypy-3-flask-0.12
Restore files previously stashed
  • Took 0 min 0 sec . View more details on here
  • Description: coverage-pypy-3-celery-3-django-2.0
Restore files previously stashed
  • Took 0 min 0 sec . View more details on here
  • Description: coverage-pypy-3-pymongo-newest
Restore files previously stashed
  • Took 0 min 0 sec . View more details on here
  • Description: coverage-pypy-3-elasticsearch-2
Restore files previously stashed
  • Took 0 min 0 sec . View more details on here
  • Description: coverage-pypy-3-gevent-newest
Restore files previously stashed
  • Took 0 min 0 sec . View more details on here
  • Description: coverage-pypy-3-graphene-2
Archive the artifacts
  • Took 0 min 0 sec . View more details on here
  • Description: [2021-04-14T07:02:34.570Z] Archiving artifacts Python-pypy-3-none tests failed : hudson.AbortExcept
Error signal
  • Took 0 min 0 sec . View more details on here
  • Description: Python-pypy-3-none tests failed : hudson.AbortException: script returned exit code 2

Log output

Expand to view the last 100 lines of log output

line] // catchError
[2021-04-14T07:01:51.674Z] ERROR: No such saved stash ‘coverage-pypy-3-flask-0.12’
[2021-04-14T07:01:52.058Z] ERROR: No such saved stash ‘coverage-pypy-3-celery-3-django-2.0’
[2021-04-14T07:01:52.391Z] ERROR: No such saved stash ‘coverage-pypy-3-pymongo-newest’
[2021-04-14T07:01:52.885Z] ERROR: No such saved stash ‘coverage-pypy-3-elasticsearch-2’
[2021-04-14T07:01:53.280Z] ERROR: No such saved stash ‘coverage-pypy-3-gevent-newest’
[2021-04-14T07:01:53.634Z] ERROR: No such saved stash ‘coverage-pypy-3-graphene-2’
[2021-04-14T07:01:54.965Z] + python3 -m coverage combine
[2021-04-14T07:02:33.715Z] + python3 -m coverage xml
[2021-04-14T07:02:33.734Z] [Cobertura] Skipping Cobertura coverage report as build was not SUCCESS or better ...
[2021-04-14T07:02:33.734Z] 
[2021-04-14T07:02:34.110Z] + curl -sLO https://code.jquery.com/jquery-3.3.1.slim.min.js
[2021-04-14T07:02:34.401Z] + curl -sLO https://cdn.jsdelivr.net/npm/htmlson.js@1.0.4/src/htmlson.js
[2021-04-14T07:02:34.570Z] Archiving artifacts
[2021-04-14T07:02:34.690Z] Stage "Building packages" skipped due to earlier failure(s)
[2021-04-14T07:02:34.724Z] Stage "Integration Tests" skipped due to earlier failure(s)
[2021-04-14T07:02:34.760Z] Stage "Benchmarks" skipped due to earlier failure(s)
[2021-04-14T07:02:34.844Z] Stage "Prepare Release" skipped due to earlier failure(s)
[2021-04-14T07:02:34.865Z] Stage "Prepare Release" skipped due to earlier failure(s)
[2021-04-14T07:02:34.900Z] Stage "Prepare Release" skipped due to earlier failure(s)
[2021-04-14T07:02:34.941Z] Stage "Prepare Release" skipped due to earlier failure(s)
[2021-04-14T07:02:36.465Z] Running on worker-854309 in /var/lib/jenkins/workspace/hon_apm-agent-python-mbp_PR-1099
[2021-04-14T07:02:36.603Z] [INFO] getVaultSecret: Getting secrets
[2021-04-14T07:02:36.912Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-04-14T07:02:39.063Z] + chmod 755 generate-build-data.sh
[2021-04-14T07:02:39.063Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-python/apm-agent-python-mbp/PR-1099/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-python/apm-agent-python-mbp/PR-1099/runs/2 FAILURE 1202079
[2021-04-14T07:02:39.063Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-python/apm-agent-python-mbp/PR-1099/runs/2/steps/?limit=10000 -o steps-info.json
[2021-04-14T07:02:45.532Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-python/apm-agent-python-mbp/PR-1099/runs/2/tests/?status=FAILED -o tests-errors.json

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Test stats 🧪

Test Results
Failed 1
Passed 9685
Skipped 7883
Total 17569

Genuine test errors 1

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Initializing / Test / Python-pypy-3-1 / test_ssl_verify_fails – tests.transports.test_urllib3

@beniwohli
Copy link
Contributor

@DougDK great find and fix! The test failure is unrelated, so I'll go ahead and merge this :) I'll do a bugfix release as soon as I've gotten a handle on the test failure

@beniwohli beniwohli merged commit 5e25840 into elastic:master Apr 14, 2021
beniwohli pushed a commit to beniwohli/apm-agent-python that referenced this pull request Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'config' in Flask Agent
3 participants