mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 00:17:07 +08:00
Extend process reconnect test
This commit is contained in:
@@ -51,7 +51,7 @@ func TestReconnectProcess(t *testing.T) {
|
||||
"2",
|
||||
},
|
||||
Reconnect: true,
|
||||
ReconnectDelay: 10 * time.Second,
|
||||
ReconnectDelay: 3 * time.Second,
|
||||
StaleTimeout: 0,
|
||||
OnExit: func(string) {
|
||||
wg.Done()
|
||||
@@ -72,6 +72,22 @@ func TestReconnectProcess(t *testing.T) {
|
||||
|
||||
require.Greater(t, p.Status().Reconnect, time.Duration(0))
|
||||
|
||||
wg.Add(1)
|
||||
|
||||
p.Start()
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
return p.Status().State == "running"
|
||||
}, 10*time.Second, 500*time.Millisecond)
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
return p.Status().State == "finished"
|
||||
}, 10*time.Second, 500*time.Millisecond)
|
||||
|
||||
wg.Wait()
|
||||
|
||||
require.Greater(t, p.Status().Reconnect, time.Duration(0))
|
||||
|
||||
p.Stop(false)
|
||||
|
||||
require.Equal(t, "finished", p.Status().State)
|
||||
|
Reference in New Issue
Block a user