@@ -60,11 +60,16 @@ func TestProgressEmitter(t *testing.T) {
|
||||
|
||||
w := evLogger.Subscribe(events.DownloadProgress)
|
||||
|
||||
c := createTmpWrapper(config.Configuration{})
|
||||
c, cfgCancel := createTmpWrapper(config.Configuration{})
|
||||
defer os.Remove(c.ConfigPath())
|
||||
c.SetOptions(config.OptionsConfiguration{
|
||||
ProgressUpdateIntervalS: 60, // irrelevant, but must be positive
|
||||
defer cfgCancel()
|
||||
waiter, err := c.Modify(func(cfg *config.Configuration) {
|
||||
cfg.Options.ProgressUpdateIntervalS = 60 // irrelevant, but must be positive
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
waiter.Wait()
|
||||
|
||||
p := NewProgressEmitter(c, evLogger)
|
||||
go p.Serve(ctx)
|
||||
@@ -109,12 +114,17 @@ func TestProgressEmitter(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendDownloadProgressMessages(t *testing.T) {
|
||||
c := createTmpWrapper(config.Configuration{})
|
||||
c, cfgCancel := createTmpWrapper(config.Configuration{})
|
||||
defer os.Remove(c.ConfigPath())
|
||||
c.SetOptions(config.OptionsConfiguration{
|
||||
ProgressUpdateIntervalS: 60, // irrelevant, but must be positive
|
||||
TempIndexMinBlocks: 10,
|
||||
defer cfgCancel()
|
||||
waiter, err := c.Modify(func(cfg *config.Configuration) {
|
||||
cfg.Options.ProgressUpdateIntervalS = 60 // irrelevant, but must be positive
|
||||
cfg.Options.TempIndexMinBlocks = 10
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
waiter.Wait()
|
||||
|
||||
fc := &fakeConnection{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user