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 key errors in test suite #416

Closed
srjames90 opened this issue Jul 28, 2020 · 1 comment · Fixed by #417
Closed

Fix key errors in test suite #416

srjames90 opened this issue Jul 28, 2020 · 1 comment · Fixed by #417
Assignees

Comments

@srjames90
Copy link
Contributor

When running the tests, you can get a failure due to the tests checking for keys in an empty dictionary. Below, is an example of the error message. Because no tracestate was passed along by the server, the tracestate map is empty and causes this error. I think it's kind of confusing to have both Failure and Errors states that indicate a failure. I think we should just check if the keys exist prior to accessing them.

ERROR: test_tracestate_included_traceparent_included (__main__.TraceContextTest)
harness sends a request with both tracestate and traceparent
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test.py", line 785, in test_tracestate_included_traceparent_included
    self.assertEqual(tracestate['foo'], '1')
  File "/Users/stevenrivera-james/workspace/test_pr/lstracer-integration-tests/propagation-tests/propagation-server/tracecontext/tracestate.py", line 35, in __getitem__
    return self._traits[key]
KeyError: 'foo'
@srjames90
Copy link
Contributor Author

srjames90 commented Jul 28, 2020

I made a quick branch and PR attempting to fix this in case @reyang wants to work off that: #417

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 a pull request may close this issue.

2 participants