Skip to content

Commit

Permalink
gc: fix and re-enable sharness tests
Browse files Browse the repository at this point in the history
I'm bumping up the waiting time significantly.
I prefer a slightly slower test to no test at all.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
  • Loading branch information
Lars Gierth committed Dec 9, 2016
1 parent 8f0c7ee commit 49802eb
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions test/sharness/t0082-repo-gc-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ test_description="Test ipfs repo auto gc"

. lib/test-lib.sh

skip_all="skipping auto repo gc tests until they can be fixed"

test_done

check_ipfs_storage() {
ipfs config Datastore.StorageMax
}
Expand All @@ -33,17 +29,16 @@ test_launch_ipfs_daemon --enable-gc

test_gc() {
test_expect_success "adding data below watermark doesn't trigger auto gc" '
ipfs add 600k1 >/dev/null &&
ipfs add -q --pin=false 600k1 >/dev/null &&
disk_usage "$IPFS_PATH/blocks" >expected &&
go-sleep 40ms &&
go-sleep 200ms &&
disk_usage "$IPFS_PATH/blocks" >actual &&
test_cmp expected actual
'

test_expect_success "adding data beyond watermark triggers auto gc" '
HASH=`ipfs add -q 600k2` &&
ipfs pin rm -r $HASH &&
go-sleep 40ms &&
ipfs add -q --pin=false 600k2 >/dev/null &&
go-sleep 200ms &&
DU=$(disk_usage "$IPFS_PATH/blocks") &&
if test $(uname -s) = "Darwin"; then
test "$DU" -lt 1400 # 60% of 2MB
Expand All @@ -53,15 +48,6 @@ test_gc() {
'
}

#TODO: conditional GC test is disabled due to files size bug in ipfs add
#test_expect_success "adding data beyond storageMax fails" '
# test_must_fail ipfs add 2M 2>add_fail_out
#'
#test_expect_success "ipfs add not enough space message looks good" '
# echo "Error: file size exceeds slack space allowed by storageMax. Maybe unpin some files?" >add_fail_exp &&
# test_cmp add_fail_exp add_fail_out
#'

test_expect_success "periodic auto gc stress test" '
for i in $(test_seq 1 20)
do
Expand Down

0 comments on commit 49802eb

Please sign in to comment.