Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 19, 2018

Fix test_dbm_gnu.test_reorganize() on macOS with gdbm 1.15: add a
larger value to make sure that the file size changes.

https://bugs.python.org/issue33901

Fix test_dbm_gnu.test_reorganize() on macOS with gdbm 1.15: add a
larger value to make sure that the file size changes.
@vstinner
Copy link
Member Author

@serhiy-storchaka: Is that better?

# bpo-33901: on macOS with gdbm 1.15, an empty database uses 16 MiB
# and adding an entry of 10,000 B has no effect on the file size.
# Add size0//2 bytes to make sure that the file size changes.
value_size = max(size0 // 2, 10000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not size0? This will guarantee that the file size will be increased (unless the database uses a compression, that is unlikely).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified my PR to use size0.

@vstinner vstinner merged commit c44d8e5 into python:master Jun 19, 2018
@vstinner vstinner deleted the gdbm_fix2 branch June 19, 2018 15:42
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 this pull request may close these issues.

4 participants