Add informers and internal go routines in manager (#2870)
* used manager's Add function in more places * exit when ctx.Done is received in archivePruner go routines * fix manager tests * fix data race * added more gpm function in manager and removed manager from a util function * closed unused channel and stopped ticker after context is done * added log statements * used context.Done inside function instead of stopper channel
This commit is contained in:
@@ -53,6 +53,8 @@ func TestAddAndWaitWithTimeout(t *testing.T) {
|
||||
err := mgr.WaitWithTimeout(1 * time.Second)
|
||||
require.NotNil(t, err, "manager WaitWithTimeout did not return an error when timeout exceeded")
|
||||
|
||||
mgr = New()
|
||||
|
||||
expectedValue := 11
|
||||
mgr.Add(context.Background(), func(ctx context.Context) {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
Reference in New Issue
Block a user