mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
test antiEntropy set to 0 works as expected
This commit is contained in:
parent
287ea370fd
commit
b761121f47
1 changed files with 27 additions and 0 deletions
|
|
@ -15,8 +15,10 @@
|
|||
package pilosa
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Ensure the file handle count is working
|
||||
|
|
@ -33,3 +35,28 @@ func TestCountOpenFiles(t *testing.T) {
|
|||
t.Error("countOpenFiles returned invalid value 0.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMonitorAntiEntropyZero(t *testing.T) {
|
||||
|
||||
td, err := ioutil.TempDir("", "")
|
||||
if err != nil {
|
||||
t.Fatalf("getting temp dir: %v", err)
|
||||
}
|
||||
s, err := NewServer(OptServerDataDir(td),
|
||||
OptServerAntiEntropyInterval(0))
|
||||
if err != nil {
|
||||
t.Fatalf("making new server: %v", err)
|
||||
}
|
||||
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
s.monitorAntiEntropy()
|
||||
close(ch)
|
||||
}()
|
||||
|
||||
select {
|
||||
case <-ch:
|
||||
case <-time.After(time.Second):
|
||||
t.Fatalf("monitorAntiEntropy should have returned immediately with duration 0")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue