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.
This commit is contained in:
Joe Betz 2017-11-14 12:17:15 -08:00
parent b32ec69f9b
commit 4b53ab0909
4 changed files with 15 additions and 12 deletions

View File

@ -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)

View File

@ -608,7 +608,7 @@ type raftReadyHandler struct {
}
func (s *EtcdServer) run() {
snap, err := s.r.raftStorage.Snapshot()
snapshot, err := s.r.raftStorage.Snapshot()
if err != nil {
plog.Panicf("get snapshot from raft storage error: %v", err)
}
@ -666,10 +666,10 @@ func (s *EtcdServer) run() {
// asynchronously accept apply packets, dispatch progress in-order
sched := schedule.NewFIFOScheduler()
ep := etcdProgress{
confState: snap.Metadata.ConfState,
snapi: snap.Metadata.Index,
appliedt: snap.Metadata.Term,
appliedi: snap.Metadata.Index,
confState: snapshot.Metadata.ConfState,
snapi: snapshot.Metadata.Index,
appliedt: snapshot.Metadata.Term,
appliedi: snapshot.Metadata.Index,
}
defer func() {

6
glide.lock generated
View File

@ -1,5 +1,5 @@
hash: f93ce836ad95fff4294b4b774ef1465d243ab4d6b20d96f27fabf9f003e71332
updated: 2017-11-21T11:33:17.843967822-08:00
hash: 8a2307db167c2f9bc511956fbec0a4400bc38db103603fc6a87bb179ac853bf5
updated: 2017-11-21T11:36:36.822426751-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: 568e959cd89871e61434c1143528d9162da89ef2
subpackages:

View File

@ -3,7 +3,7 @@ import:
- package: github.com/bgentry/speakeasy
version: 36e9cfdd690967f4f690c6edcc9ffacd006014a0
- 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