mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
Make sure to stop processes when exiting integration test
This commit is contained in:
parent
1e9110b763
commit
a7694029e2
@ -132,11 +132,6 @@ func testSyncCluster(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
p, err := scStartProcesses()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Prepare the expected state of folders after the sync
|
||||
c1, err := directoryContents("s1")
|
||||
if err != nil {
|
||||
@ -161,6 +156,17 @@ func testSyncCluster(t *testing.T) {
|
||||
}
|
||||
expected := [][]fileInfo{e1, e2, e3}
|
||||
|
||||
// Start the syncers
|
||||
p, err := scStartProcesses()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
for i := range p {
|
||||
p[i].stop()
|
||||
}
|
||||
}()
|
||||
|
||||
for count := 0; count < 5; count++ {
|
||||
log.Println("Forcing rescan...")
|
||||
|
||||
@ -242,10 +248,6 @@ func testSyncCluster(t *testing.T) {
|
||||
}
|
||||
expected = [][]fileInfo{e1, e2, e3}
|
||||
}
|
||||
|
||||
for i := range p {
|
||||
p[i].stop()
|
||||
}
|
||||
}
|
||||
|
||||
func scStartProcesses() ([]syncthingProcess, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user