fix intermittent test coverage #2891
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#2891
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
strikeoutthese items as we fix them.src/allmydata/mutable/servermap.py
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 acollections.defaultdict
, rather than needing any new tests.[L 923: ServermapUpdater._try_to_validate_privkey](
74e7ef4b98/src/allmydata/mutable/servermap.py (L923)
)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 (ticket:3540)
L 496 Publish.publish
src/allmydata/immutable/upload.py
Tahoe2ServerSelector._buckets_allocated()
the
if s in self.homeless_shares
inside the non-Failure path doesn't always exercise both sides of the branchsrc/allmydata/immutable/downloader/share.py
Share.loop()
this share-is-corrupted branch is not always exercised
L228-236
the DataUnavailable branch is not always exercised
L277-279 Share._do_loop()
this doesn't always see a non-empty
disappointment
array, and sometimes doesn't raise DataUnavailable. This is the parent cause of the L228-L236 non-coverage above.L386-389 _satisfy_offsets()
the share_hashes_size test doesn't exercise both sides of the branch
L761 _got_data()
the
if not self._alive
check doesn't always exercise both branchessrc/allmydata/util/dictutil.py
src/allmydata/stats.py
[L64-68 LoadMonitor.get_stats()](
3f2f7dfb05/src/allmydata/stats.py (L68)
)noticed in a build of PR421
get_stats() returns an average of the last 60 datapoints, but if there are no datapoints at all, a different branch is taken
that no-datapoints branch is sometimes not covered by the tests
src/allmydata/web/status.py
also from that PR421 build
[L758 RetrieveStatusPage.render_server_timings()](
3f2f7dfb05/src/allmydata/web/status.py (L758)
)sometimes the
fetch_per_server
timing data is empty, which skips parts of this function[L925 MapupdateStatusPage.render_privkey_from()](
3f2f7dfb05/src/allmydata/web/status.py (L925)
)sometimes this is called when the privkey has not been fetched, so it skips the affirmative side of the branch
L1117 Status.childFactory()
the loop that looks for a "down-%s" name in h.list_all_download_statuses() doesn't always exercise both sides of the
if s.get_counter() == count
clauseIn a4be2dc/trunk:
added dictutil misses, updated format of the table, struck out the add_per_server_time that was fixed in a4be2dc
In 3f2f7df/trunk:
fixed dictutil.py (lines 29, 230, 438) with [3f2f7df]
added intermittence from an old build of PR421 (stats.py, web/status.py)
more intermittence noticed in tests: immutable/upload.py and immutable/downloader/share.py
In 27348be/trunk:
[27348be] deleted most of dictutil.py, so those lines are no longer a problem