[events] Fix deadlock in TestExchangeBasic
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
This commit is contained in:
		| @@ -52,11 +52,8 @@ func TestExchangeBasic(t *testing.T) { | ||||
| 	eventq2, errq2 := exchange.Subscribe(ctx2) | ||||
|  | ||||
| 	t.Log("publish") | ||||
| 	var wg sync.WaitGroup | ||||
| 	wg.Add(1) | ||||
| 	errChan := make(chan error) | ||||
| 	go func() { | ||||
| 		defer wg.Done() | ||||
| 		defer close(errChan) | ||||
| 		for _, event := range testevents { | ||||
| 			if err := exchange.Publish(ctx, "/test", event); err != nil { | ||||
| @@ -69,7 +66,6 @@ func TestExchangeBasic(t *testing.T) { | ||||
| 	}() | ||||
|  | ||||
| 	t.Log("waiting") | ||||
| 	wg.Wait() | ||||
| 	if err := <-errChan; err != nil { | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Gaurav Singh
					Gaurav Singh