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

Initial calculation of unicode table is not atomic #302

Closed
DRMacIver opened this issue Mar 16, 2016 · 6 comments
Closed

Initial calculation of unicode table is not atomic #302

DRMacIver opened this issue Mar 16, 2016 · 6 comments

Comments

@DRMacIver
Copy link
Member

If you're using e.g. pytest-xdist this can result in a corrupt unicode table, which is bad. Instead the file should be created under a temporary name then moved atomically.

@DRMacIver
Copy link
Member Author

@cristicbz
Copy link
Contributor

I think we hit this in CI all the time. Here's the stack trace if helpful:

reinfer/models/voc/label/tests/test_batch.py:17: in <module>
    from ...shared.tests.test_prediction_store import s_predictions
/env/local/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:171: in load_module
    py.builtin.exec_(co, mod.__dict__)
reinfer/models/voc/shared/tests/test_prediction_store.py:46: in <module>
    s.tuples(s.text(min_size=1, max_size=3).map(lambda t: t.encode('utf-8')),
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/strategies.py:130: in map
    pack=pack, strategy=self
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/strategies.py:245: in __init__
    self.is_empty = strategy.is_empty
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/deferred.py:59: in is_empty
    return self.wrapped_strategy.is_empty
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/deferred.py:67: in wrapped_strategy
    **self.__kwargs
/env/local/lib/python2.7/site-packages/hypothesis/strategies.py:655: in text
    max_size=max_size
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/strings.py:104: in __init__
    strategy=list_of_one_char_strings_strategy
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/strategies.py:245: in __init__
    self.is_empty = strategy.is_empty
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/deferred.py:59: in is_empty
    return self.wrapped_strategy.is_empty
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/deferred.py:67: in wrapped_strategy
    **self.__kwargs
/env/local/lib/python2.7/site-packages/hypothesis/strategies.py:439: in lists
    if elements.is_empty:
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/deferred.py:59: in is_empty
    return self.wrapped_strategy.is_empty
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/deferred.py:67: in wrapped_strategy
    **self.__kwargs
/env/local/lib/python2.7/site-packages/hypothesis/strategies.py:620: in characters
    max_codepoint=max_codepoint)
/env/local/lib/python2.7/site-packages/hypothesis/searchstrategy/strings.py:46: in __init__
    max_codepoint=max_codepoint,
/env/local/lib/python2.7/site-packages/hypothesis/internal/charmap.py:143: in query
    catkey = _category_key(exclude_categories, include_categories)
/env/local/lib/python2.7/site-packages/hypothesis/internal/charmap.py:104: in _category_key
    cs = categories()
/env/local/lib/python2.7/site-packages/hypothesis/internal/charmap.py:70: in categories
    cm = charmap()
/env/local/lib/python2.7/site-packages/hypothesis/internal/charmap.py:59: in charmap
    _charmap = dict(pickle.loads(i.read()))
/usr/lib/python2.7/pickle.py:1388: in loads
    return Unpickler(file).load()
/usr/lib/python2.7/pickle.py:864: in load
    dispatch[key](self)
/usr/lib/python2.7/pickle.py:886: in load_eof
    raise EOFError
E   EOFError

@bcroq
Copy link

bcroq commented Nov 29, 2016

I still randomly get this error using hypothesis 3.1.0.

@DRMacIver
Copy link
Member Author

Do you still get this error when using a more recent version of Hypothesis? The latest is 3.6.0

@bcroq
Copy link

bcroq commented Nov 29, 2016

@DRMacIver I bump the requirements to hypothesis==3.6.0... let's wait and see.

Thanks.

@bcroq
Copy link

bcroq commented Dec 2, 2016

@DRMacIver 3 days later, I confirm I don't get this error anymore.

Thanks again.

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

No branches or pull requests

3 participants