mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
model: TestIgnores should not randomly fail
This commit is contained in:
parent
ab6bcab78a
commit
739c525a98
2
internal/model/.gitignore
vendored
Normal file
2
internal/model/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.stfolder
|
||||
.stignore
|
@ -10,6 +10,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -49,6 +50,10 @@ func init() {
|
||||
DeviceID: device1,
|
||||
},
|
||||
},
|
||||
Options: config.OptionsConfiguration{
|
||||
// Don't remove temporaries directly on startup
|
||||
KeepTemporariesH: 1,
|
||||
},
|
||||
}
|
||||
defaultConfig = config.Wrap("/tmp/test", _defaultConfig)
|
||||
}
|
||||
@ -469,6 +474,9 @@ func TestIgnores(t *testing.T) {
|
||||
return true
|
||||
}
|
||||
|
||||
// Assure a clean start state
|
||||
ioutil.WriteFile("testdata/.stignore", []byte(".*\nquux\n"), 0644)
|
||||
|
||||
db, _ := leveldb.Open(storage.NewMemStorage(), nil)
|
||||
m := NewModel(defaultConfig, protocol.LocalDeviceID, "device", "syncthing", "dev", db)
|
||||
m.AddFolder(defaultFolderConfig)
|
||||
@ -989,7 +997,6 @@ func TestGlobalDirectoryTree(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGlobalDirectorySelfFixing(t *testing.T) {
|
||||
|
||||
db, _ := leveldb.Open(storage.NewMemStorage(), nil)
|
||||
m := NewModel(defaultConfig, protocol.LocalDeviceID, "device", "syncthing", "dev", db)
|
||||
m.AddFolder(defaultFolderConfig)
|
||||
|
Loading…
Reference in New Issue
Block a user