Opened at 2017-07-23T16:58:50Z
Last modified at 2020-11-30T18:53:19Z
#2891 new defect
fix intermittent test coverage — at Version 2
Reported by: | warner | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | code | Version: | 1.12.1 |
Keywords: | Cc: | ||
Launchpad Bug: |
Description (last modified by warner)
This ticket is to keep track of lines which sometimes get covered during unit tests and which sometimes do not. This probably happens because those lines are only exercised by "system" -style tests, which randomly hit some servers and not others. We should fix these by writing more narrowly-focussed "unit"-style tests that exercise just the function in question, deterministically.
The most annoying thing about these tests is when they cause perfectly valid pull requests to be flagged as broken (because the test coverage happened to drop when they went through CI, through no fault of the PR's changes).
Let's strikeout these items as we fix them.
- src/allmydata/mutable/servermap.py
~L 39: UpdateStatus.add_per_server_time~- the status object's .timings["per_server"] attribute is a dict-of-lists, and line 39 handles the case where we *don't* have to add a new entry to the dict. This should just be replaced by a collections.defaultdict, rather than needing any new tests.
- L 923: ServermapUpdater._try_to_validate_privkey
- this clause checks that the share contained an (encrypted) RSA signing key that matches the expectation we got from the writecap. The clause should succeed for normal shares, but will fail for corrupted shares. Apparently we have a test that corrupts some shares, but which then doesn't always look at them.
- src/allmydata/mutable/publish.py
- L 451: Publish.publish
- to exercise this, we need some bad shares recorded in the servermap
- L 496 Publish.publish
- L 451: Publish.publish
Change History (2)
comment:1 Changed at 2017-07-28T04:04:30Z by Brian Warner <warner@…>
comment:2 Changed at 2017-08-10T17:40:23Z by warner
- Description modified (diff)
added dictutil misses, updated format of the table, struck out the add_per_server_time that was fixed in [a4be2dc]
In a4be2dc/trunk: