Skip to content

Commit

Permalink
Fix a race condition in recorder tests
Browse files Browse the repository at this point in the history
When we switch the filesystem under a running recorder during
failure tests, we don't want the garbage collection
deleteObsoleteFiles() to run at the same time, since he may
well be traversing the filesystem being replaced.
And using the real expected type/unit (time) is always better.
  • Loading branch information
bpineau committed Apr 18, 2018
1 parent e73eba1 commit 0c56a6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/recorder/recorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestRecorder(t *testing.T) {
conf := &config.KfConfig{
Logger: log.New("info", "", "test"),
LocalDir: "/tmp/ktest", // fake dir (in memory fs provided by Afero)
ResyncIntv: 60,
ResyncIntv: 60 * time.Second,
}

rec := New(conf, evt).Start()
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestDryRunRecorder(t *testing.T) {
conf := &config.KfConfig{
Logger: log.New("info", "", "test"),
LocalDir: "/tmp/ktest",
ResyncIntv: 60,
ResyncIntv: 60 * time.Second,
}

conf.DryRun = true
Expand Down Expand Up @@ -106,7 +106,7 @@ func TestFailingFSRecorder(t *testing.T) {
conf := &config.KfConfig{
Logger: log.New("info", "", "test"),
LocalDir: "/tmp/ktest", // fake dir (in memory fs provided by Afero)
ResyncIntv: 60,
ResyncIntv: 60 * time.Second,
}

rec := New(conf, evt).Start()
Expand Down

0 comments on commit 0c56a6f

Please sign in to comment.