From 4b9bfa17eefcd705f21e56909e048f49928ead1a Mon Sep 17 00:00:00 2001 From: Joe Betz Date: Tue, 14 Nov 2017 12:17:15 -0800 Subject: [PATCH] test: Clean agent directories on disk before functional test runs, not after This is primarily so CI tooling can capture the agent logs after the functional tester runs. --- cmd/vendor/github.com/coreos/bbolt/freelist.go | 9 ++++++--- glide.lock | 6 +++--- glide.yaml | 2 +- test | 3 +-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cmd/vendor/github.com/coreos/bbolt/freelist.go b/cmd/vendor/github.com/coreos/bbolt/freelist.go index 78e71cbf2..266f15429 100644 --- a/cmd/vendor/github.com/coreos/bbolt/freelist.go +++ b/cmd/vendor/github.com/coreos/bbolt/freelist.go @@ -132,9 +132,9 @@ func (f *freelist) free(txid txid, p *page) { allocTxid, ok := f.allocs[p.id] if ok { delete(f.allocs, p.id) - } else if (p.flags & (freelistPageFlag | metaPageFlag)) != 0 { - // Safe to claim txid as allocating since these types are private to txid. - allocTxid = txid + } else if (p.flags & freelistPageFlag) != 0 { + // Freelist is always allocated by prior tx. + allocTxid = txid - 1 } for id := p.id; id <= p.id+pgid(p.overflow); id++ { @@ -233,6 +233,9 @@ func (f *freelist) freed(pgid pgid) bool { // read initializes the freelist from a freelist page. func (f *freelist) read(p *page) { + if (p.flags & freelistPageFlag) == 0 { + panic(fmt.Sprintf("invalid freelist page: %d, page type is %s", p.id, p.typ())) + } // If the page.count is at the max uint16 value (64k) then it's considered // an overflow and the size of the freelist is stored as the first element. idx, count := 0, int(p.count) diff --git a/glide.lock b/glide.lock index 02426f3e6..94f28c403 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 1f8c90fc46d1142a8536aac6461ecc5c8ba22351f90e17dad20b18d21b64c413 -updated: 2017-11-16T12:42:55.67763215-08:00 +hash: 49834a8aac35bf7f5978c26cd6ea8c2d929369d6da2a3afbf1606a00e8d4a5e6 +updated: 2017-11-16T12:43:55.076614824-08:00 imports: - name: github.com/beorn7/perks version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9 @@ -10,7 +10,7 @@ imports: - name: github.com/cockroachdb/cmux version: 112f0506e7743d64a6eb8fedbcff13d9979bbf92 - name: github.com/coreos/bbolt - version: 3c6cbfb299c11444eb2f8c9d48f0d2ce09157423 + version: 32c383e75ce054674c53b5a07e55de85332aee14 - name: github.com/coreos/go-semver version: 8ab6407b697782a06568d4b7f1db25550ec2e4c6 subpackages: diff --git a/glide.yaml b/glide.yaml index 33b8950aa..aea85e920 100644 --- a/glide.yaml +++ b/glide.yaml @@ -3,7 +3,7 @@ import: - package: github.com/bgentry/speakeasy version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd - package: github.com/coreos/bbolt - version: v1.3.1-coreos.3 + version: v1.3.1-coreos.5 - package: github.com/cockroachdb/cmux version: 112f0506e7743d64a6eb8fedbcff13d9979bbf92 - package: github.com/coreos/go-semver diff --git a/test b/test index eecbc8ed3..513af0a11 100755 --- a/test +++ b/test @@ -104,9 +104,8 @@ function integration_pass { } function functional_pass { - # Clean up any data and logs from previous runs + # Clean up any data and logs from previous runs rm -rf ./agent-* - for a in 1 2 3; do mkdir -p ./agent-$a ./bin/etcd-agent -etcd-path ./bin/etcd -etcd-log-dir "./agent-$a" -port ":${a}9027" -use-root=false &