test_asset_cache: ALinkAtAnIndexedNameIsRemovedAsALinkAndItsTargetKept fails on the release tip (blobsEvicted 0, the link remains)

Open
#2,916 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend, testing

Research direction

Start with src/runtime/tests/test_asset_cache.cpp, especially AssetCache.ALinkAtAnIndexedNameIsRemovedAsALinkAndItsTargetKept, and trace Evict in src/runtime/patch/asset_cache.cpp:561-635 into nevr_owned::RemoveEntry in src/core/owned_remove_win32.cpp. First reproduce with just test-auth-unit test_asset_cache under the described Wine setup, then log the index names, link attributes result, and removal outcome. Compare with a second Wine prefix or native Windows; done means the cause is identified and either the removal is fixed with the mutant proof or the test skips with a named, test-checked reason.

Written by the indexing model from the issue text.

Description

bug

Evidence at 59710727b

The release tip fails one case of the GTest binary test_asset_cache, built by just test-auth-unit test_asset_cache (mingw-release, run under Wine with a Wine prefix that has a z: drive, owned by the seat that ran it).

Ran on a worktree of 59710727b: just test-auth-unit test_asset_cache, exit 1:

  • [ FAILED ] AssetCache.ALinkAtAnIndexedNameIsRemovedAsALinkAndItsTargetKept
  • src/runtime/tests/test_asset_cache.cpp:453: r.blobsEvicted is 0, expected 1.
  • src/runtime/tests/test_asset_cache.cpp:454: Exists(link) is true, expected false.
  • [ PASSED ] 32 tests. (the other cases of the binary pass)

The same two assertions with the same values fail on aa70ceba4 (branch nevr-runtime-one/2903-per-target-piece, parent 59710727b), in a run of the same target under the same Wine prefix.

The case does not skip: CreateSymbolicLinkW returns success under that prefix, so the case runs past its GTEST_SKIP branch (src/runtime/tests/test_asset_cache.cpp, the case ALinkAtAnIndexedNameIsRemovedAsALinkAndItsTargetKept).

Code the case exercises, read at 59710727b:

  • src/runtime/patch/asset_cache.cpp:561-635 (Evict): each listed name is sized and stamped with GetFileAttributesExW (line 595), then a blob leaf is removed with nevr_owned::RemoveEntry.
  • src/core/owned_remove_win32.cpp:176: the entry is opened with allow_link true, so the link check at :107 does not refuse this entry.

Not shown

  • Why Evict leaves the link. The run does not show whether the name is read from the index, whether GetFileAttributesExW on the link returns the target's size, or what RemoveEntry returns for the entry. No line of the run prints them.
  • Whether the environment causes it. The case passes on no run in this evidence, and it has not been run on native Windows or under a second Wine prefix.
  • Whether the case passed on any earlier tag. Not measured.

Falsifier

The same case passing on 59710727b under a Wine prefix made by a different user, or on native Windows, would show the failure depends on the environment, not on Evict. A run that prints each RemoveEntry result for the link as anything but kRemoved would point at the code path rather than the environment.

Work

  1. Under the same prefix kind, print for this case only: the names Evict reads from the index, the GetFileAttributesExW result for the link, and the RemoveEntry outcome. Read each line against the code at the three places above.
  2. Run the same case on a second prefix (another user's or a fresh one) and, if available, on native Windows, at 59710727b.
  3. If the code is wrong, fix it and add the failing case's mutant proof. If the environment is the cause, the case must skip with a named reason decided by its own check (the link creation it already makes), never a silent skip, and the reason is written in the test.

This is a red on the release line that is not the cause of #2903; #2903 is not blocked on this issue's fix.

Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.