MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / teardownChain

Function teardownChain

xenomint/chain_test.go:136–158  ·  view source on GitHub ↗
(testName string, c *Chain)

Source from the content-addressed store, hash-verified

134}
135
136func teardownChain(testName string, c *Chain) (err error) {
137 var (
138 fl = path.Join(testingDataDir, strings.Replace(testName, "/", "-", -1))
139 )
140 if err = c.Stop(); err != nil {
141 err = errors.Wrap(err, "failed to teardown bench environment: ")
142 return
143 }
144 if err = os.Remove(fl); err != nil {
145 err = errors.Wrap(err, "failed to teardown bench environment: ")
146 return
147 }
148 if err = os.Remove(fmt.Sprint(fl, "-shm")); err != nil && !os.IsNotExist(err) {
149 err = errors.Wrap(err, "failed to teardown bench environment: ")
150 return
151 }
152 if err = os.Remove(fmt.Sprint(fl, "-wal")); err != nil && !os.IsNotExist(err) {
153 err = errors.Wrap(err, "failed to teardown bench environment: ")
154 return
155 }
156
157 return nil
158}
159
160func teardownBenchmarkChain(b *testing.B, c *Chain) {
161 b.StopTimer()

Callers 3

teardownBenchmarkChainFunction · 0.85
TestChainFunction · 0.85
TestMuxServiceFunction · 0.85

Calls 2

StopMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected