()
| 198 | } |
| 199 | |
| 200 | func stopNodes() { |
| 201 | var wg sync.WaitGroup |
| 202 | testDir := FJ(testWorkingDir, "./fuse") |
| 203 | for _, nodeCmd := range nodeCmds { |
| 204 | wg.Add(1) |
| 205 | go func(thisCmd *utils.CMD) { |
| 206 | defer wg.Done() |
| 207 | thisCmd.Cmd.Process.Signal(syscall.SIGTERM) |
| 208 | thisCmd.Cmd.Wait() |
| 209 | grepRace := exec.Command("/bin/sh", "-c", "grep -A 50 'DATA RACE' "+thisCmd.LogPath) |
| 210 | out, _ := grepRace.Output() |
| 211 | if len(out) > 2 { |
| 212 | log.Fatalf("DATA RACE in %s :\n%s", thisCmd.Cmd.Path, string(out)) |
| 213 | } |
| 214 | }(nodeCmd) |
| 215 | } |
| 216 | |
| 217 | wg.Wait() |
| 218 | cmd := exec.Command("/bin/sh", "-c", fmt.Sprintf(`cd %s && find . -name '*.db' -exec rm -vf {} \;`, testDir)) |
| 219 | cmd.Run() |
| 220 | cmd = exec.Command("/bin/sh", "-c", fmt.Sprintf(`cd %s && find . -name '*.db-shm' -exec rm -vf {} \;`, testDir)) |
| 221 | cmd.Run() |
| 222 | cmd = exec.Command("/bin/sh", "-c", fmt.Sprintf(`cd %s && find . -name '*.db-wal' -exec rm -vf {} \;`, testDir)) |
| 223 | cmd.Run() |
| 224 | cmd = exec.Command("/bin/sh", "-c", fmt.Sprintf(`cd %s && find . -name 'db.meta' -exec rm -vf {} \;`, testDir)) |
| 225 | cmd.Run() |
| 226 | cmd = exec.Command("/bin/sh", "-c", fmt.Sprintf(`cd %s && find . -name 'public.keystore' -exec rm -vf {} \;`, testDir)) |
| 227 | cmd.Run() |
| 228 | cmd = exec.Command("/bin/sh", "-c", fmt.Sprintf(`cd %s && find . -name '*.public.keystore' -exec rm -vf {} \;`, testDir)) |
| 229 | cmd.Run() |
| 230 | cmd = exec.Command("/bin/sh", "-c", fmt.Sprintf(`cd %s && find . -name '*.ldb' -exec rm -vrf {} \;`, testDir)) |
| 231 | cmd.Run() |
| 232 | } |
| 233 | |
| 234 | func initTestDB() (*sql.DB, func()) { |
| 235 |
no test coverage detected