Merge lp:~jelmer/brz/chk-leaf-tests into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/chk-leaf-tests
Merge into: lp:brz
Diff against target: 15 lines (+2/-3)
1 file modified
breezy/tests/per_repository_chk/test_supported.py (+2/-3)
To merge this branch: bzr merge lp:~jelmer/brz/chk-leaf-tests
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+358618@code.launchpad.net

Commit message

Fix flakyness of test_missing_chk_leaf_for_inventory.

Description of the change

Fix failure of breezy.tests.per_repository_chk.test_supported.TestCommitWriteGroupIntegrityCheck.test_missing_chk_leaf_for_inventory when run with PYTHONHASHSEED=2.

This just makes it drop all keys that are not for the roots for the relevant
revisions, rather than picking a random key and hoping for the best.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/per_repository_chk/test_supported.py'
2--- breezy/tests/per_repository_chk/test_supported.py 2018-07-25 18:15:53 +0000
3+++ breezy/tests/per_repository_chk/test_supported.py 2018-11-12 03:10:56 +0000
4@@ -267,9 +267,8 @@
5 inv_b.id_to_entry.key(), inv_b.parent_id_basename_to_file_id.key(),
6 inv_c.id_to_entry.key(), inv_c.parent_id_basename_to_file_id.key()]
7 all_chks = src_repo.chk_bytes.keys()
8- # Pick a non-root key to drop
9- key_to_drop = all_chks.difference(chk_root_keys_only).pop()
10- all_chks.discard(key_to_drop)
11+ for key_to_drop in all_chks.difference(chk_root_keys_only):
12+ all_chks.discard(key_to_drop)
13 repo.lock_write()
14 repo.start_write_group()
15 repo.chk_bytes.insert_record_stream(

Subscribers

People subscribed via source and target branches