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

Greenlet dict wrapper behaves surprisingly on Travis #8

Closed
hynek opened this issue Oct 21, 2013 · 2 comments
Closed

Greenlet dict wrapper behaves surprisingly on Travis #8

hynek opened this issue Oct 21, 2013 · 2 comments
Labels
Milestone

Comments

@hynek
Copy link
Owner

@hynek hynek commented Oct 21, 2013

The addition of unrelated code led to a test failure: https://travis-ci.org/hynek/structlog/builds/11921511

=================================== FAILURES ===================================
_______________ TestThreadLocalDict.test_non_dunder_proxy_works ________________
self = <tests.test_threadlocal.TestThreadLocalDict object at 0x23a7c50>
D = <class 'structlog.threadlocal.WrappedDict-f561929d-5fca-4b25-afcf-956a40968ad0'>
    def test_non_dunder_proxy_works(self, D):
        d = D({'a': 42})
>       assert 1 == len(d)
E       assert 1 == 2
E        +  where 2 = len(<WrappedDict-f561929d-5fca-4b25-afcf-956a40968ad0({'a': 42, 'b': 23})>)
tests/test_threadlocal.py:131: AssertionError

It appears that the greenlet wrapper does not create distinct dict classes on each call but just one that shares the same data store within one greenlet.

That shouldn’t be a problem in practice, but it’s contrary to what the docs say.

I wasn’t able to trigger this bug locally. The test is commented out as of 1995a8b.

/cc @hpk42

hynek added a commit that referenced this issue Oct 22, 2013
Switching py33-green to actually run w/ Python 3.3 helped. Leaving #8 open
though since it didn't make any sense. Waiting if it'll re-appear.
@hynek
Copy link
Owner Author

@hynek hynek commented Oct 22, 2013

Making tox use actually Python 3.3 made it go away. This is really odd so I’m keeping this bug open.

@hynek
Copy link
Owner Author

@hynek hynek commented Jul 29, 2014

Fixed by 7de1f06

@hynek hynek closed this Jul 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant