Skip to content

Commit

Permalink
Fix flaky test_monitor (#4537)
Browse files Browse the repository at this point in the history
* Fix flaky test_monitor

Signed-off-by: Kevin Su <[email protected]>

* fix test

Signed-off-by: Kevin Su <[email protected]>

---------

Signed-off-by: Kevin Su <[email protected]>
Co-authored-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
pingsutw and eapolinario authored Dec 6, 2023
1 parent 2553153 commit b9907f4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

func Test_monitor(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
tCtx := &mocks.TaskExecutionContext{}
ctxMeta := &mocks.TaskExecutionMetadata{}
execID := &mocks.TaskExecutionID{}
Expand Down Expand Up @@ -70,6 +71,7 @@ func Test_monitor(t *testing.T) {

// Wait for sync to run to actually delete the resource
wg.Wait()
cancel()
cachedItem, err = cacheObj.GetOrCreate("generated_name", CacheItem{Resource: "new_resource"})
assert.NoError(t, err)
assert.Equal(t, "new_resource", cachedItem.(CacheItem).Resource.(string))
Expand Down

0 comments on commit b9907f4

Please sign in to comment.