Skip to content

RepoSize incorrect with symlink #4408

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

Closed
Stebalien opened this issue Nov 21, 2017 · 7 comments · Fixed by #4443
Closed

RepoSize incorrect with symlink #4408

Stebalien opened this issue Nov 21, 2017 · 7 comments · Fixed by #4443
Assignees
Labels
topic/test failure Topic test failure

Comments

@Stebalien
Copy link
Member

Interesting sharness error:

make: *** [test/sharness/t0088-repo-stat-symlink.sh] Error 1
make: *** Waiting for unfinished jobs....
*** test/sharness/t0088-repo-stat-symlink.sh ***
# TEST_VERBOSE=1
# TEST_NO_FUSE=1
# TEST_NO_PLUGIN=
# TEST_EXPENSIVE=1
# TEST_OS=LINUX
expecting success: 
  mkdir sym_link_target &&
  ln -s sym_link_target .ipfs

ok 1 - create symbolic link for IPFS_PATH

expecting success: 
    export IPFS_PATH="$(pwd)/.ipfs" &&
    ipfs init --profile=test -b=1024 > /dev/null
  
ok 2 - ipfs init succeeds

expecting success: 
    mkdir mountdir ipfs ipns &&
    test_config_set Mounts.IPFS "$(pwd)/ipfs" &&
    test_config_set Mounts.IPNS "$(pwd)/ipns" ||
    test_fsh cat "\"$IPFS_PATH/config\""
  
ipfs config  "Mounts.IPFS" "/go/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0088-repo-stat-symlink.sh/ipfs"
ipfs config  "Mounts.IPNS" "/go/src/github.com/ipfs/go-ipfs/test/sharness/trash directory.t0088-repo-stat-symlink.sh/ipns"
ok 3 - prepare config -- mounting

expecting success: 
  export IPFS_PATH="sym_link_target" &&
  reposize_direct=$(ipfs repo stat | grep RepoSize | awk '{ print $2 }') &&
  export IPFS_PATH=".ipfs" &&
  reposize_symlink=$(ipfs repo stat | grep RepoSize | awk '{ print $2 }') &&
  test $reposize_symlink -ge $reposize_direct

not ok 4 - 'ipfs repo stat' RepoSize is correct with sym link
#	
#	  export IPFS_PATH="sym_link_target" &&
#	  reposize_direct=$(ipfs repo stat | grep RepoSize | awk '{ print $2 }') &&
#	  export IPFS_PATH=".ipfs" &&
#	  reposize_symlink=$(ipfs repo stat | grep RepoSize | awk '{ print $2 }') &&
#	  test $reposize_symlink -ge $reposize_direct
#	

# failed 1 among 4 test(s)
1..4
test/sharness/Rules.mk:31: recipe for target 'test/sharness/t0088-repo-stat-symlink.sh' failed
@Stebalien Stebalien added the topic/test failure Topic test failure label Nov 21, 2017
@kevina kevina self-assigned this Nov 28, 2017
@kevina
Copy link
Contributor

kevina commented Nov 28, 2017

Related p.r.: #4305

@kevina
Copy link
Contributor

kevina commented Nov 28, 2017

I can't reproduce this and the builds now seam to be passing.

In order to see what is going on I would need to add something like

echo "reposize_symlink: $reposize_symlink  reposize_direct: reposize_direct"

to see why the numbers are not matching as there is no indication of any other errors.

@magik6k
Copy link
Member

magik6k commented Nov 28, 2017

@kevina
Copy link
Contributor

kevina commented Nov 28, 2017

By guess is the repo size is decreasing (instead of increating) slightly. #4434 should help get to the bottom of this.

@kevina
Copy link
Contributor

kevina commented Nov 28, 2017

@magik6k #4434 was just merged, could you rebase and see if it still fails?

@Stebalien
Copy link
Member Author

I just ran into this:

expecting success: 
  export IPFS_PATH="sym_link_target" &&
  reposize_direct=$(ipfs repo stat | grep RepoSize | awk '{ print $2 }') &&
  export IPFS_PATH=".ipfs" &&
  reposize_symlink=$(ipfs repo stat | grep RepoSize | awk '{ print $2 }') &&
  echo "reposize_symlink: $reposize_symlink;  reposize_direct: $reposize_direct" &&
  test $reposize_symlink -ge $reposize_direct

reposize_symlink: 128958;  reposize_direct: 129619

So, it looks like the repo size is decreasing (by 661 bytes in this case).

@kevina
Copy link
Contributor

kevina commented Nov 30, 2017

Yeah, that what I thought would happen. We need to rethink the test or introduce a fuze factor...

Why it changes in size could be any number of things.

Stebalien added a commit that referenced this issue Nov 30, 2017
We appear to be writing to leveldb on each command.

fixes #4408

License: MIT
Signed-off-by: Steven Allen <[email protected]>
Stebalien added a commit that referenced this issue Dec 1, 2017
Before, we'd check to make sure the repo, when checked through a symlink, is at
least as large as the repo *before* we checked it through the symlink. However,
this assumes that the repo can't shrink.

Really, this test exists to ensure we measure the repo size itself instead of
the size of the symlink; this commit changes the test to reflect this.

This test fails when 54d7e03 is reverted.

fixes #4408

License: MIT
Signed-off-by: Steven Allen <[email protected]>
Stebalien added a commit that referenced this issue Dec 1, 2017
Before, we'd check to make sure the repo, when checked through a symlink, is at
least as large as the repo *before* we checked it through the symlink. However,
this assumes that the repo can't shrink.

Really, this test exists to ensure we measure the repo size itself instead of
the size of the symlink; this commit changes the test to reflect this.

This test fails when 54d7e03 is reverted.

fixes #4408

License: MIT
Signed-off-by: Steven Allen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/test failure Topic test failure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants