Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: make sure the directory handle is kept alive in rename loop #30

Merged
merged 1 commit into from
Sep 30, 2024

Commits on Sep 30, 2024

  1. tests: make sure the directory handle is kept alive in rename loop

    It turns out the GC can close the directory during our loop in CI
    sometimes, leading to the following failures (note that dir.Fd() returns
    -1, which is a closed directory):
    
      === RUN   TestPartialLookup_RacingRename/openat2=true/swap-dir-danglinglink-basic
      panic: renameat2([-1]"/tmp/TestPartialLookup_RacingRenameopenat2=trueswap-dir-file-basic3291115487/001/tree", "a/b", ..., "file", RENAME_EXCHANGE) = no such file or directory
    
      goroutine 552 [running]:
      github.com/cyphar/filepath-securejoin.doRenameExchangeLoop(0xc000027680, 0xc0000276e0, 0xc0000025a8, {0x66c786, 0x3}, {0x66c8f4, 0x4})
          /home/runner/work/filepath-securejoin/filepath-securejoin/util_linux_test.go:111 +0x38c
      created by github.com/cyphar/filepath-securejoin.TestPartialLookup_RacingRename.func1.1 in goroutine 551
          /home/runner/work/filepath-securejoin/filepath-securejoin/lookup_linux_test.go:561 +0x525
      exit status 2
    
    Signed-off-by: Aleksa Sarai <[email protected]>
    cyphar committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    1446241 View commit details
    Browse the repository at this point in the history