Преглед изворни кода

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.
Joe Betz пре 8 година
родитељ
комит
4b9bfa17ee
4 измењених фајлова са 11 додато и 9 уклоњено
  1. 6 3
      cmd/vendor/github.com/coreos/bbolt/freelist.go
  2. 3 3
      glide.lock
  3. 1 1
      glide.yaml
  4. 1 2
      test

+ 6 - 3
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)

+ 3 - 3
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:

+ 1 - 1
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

+ 1 - 2
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 &