From d619e4ada9b88eddc916fa1d44c29e548a731284 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Wed, 24 Dec 2014 09:26:43 -0500 Subject: [PATCH] cancel on exit --- epictest/addcat_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epictest/addcat_test.go b/epictest/addcat_test.go index 19bb0430a..2136ec4f9 100644 --- a/epictest/addcat_test.go +++ b/epictest/addcat_test.go @@ -89,7 +89,8 @@ func RandomBytes(n int64) []byte { } func AddCatBytes(data []byte, conf Config) error { - ctx := context.Background() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() mn := mocknet.New(ctx) // defer mn.Close() FIXME does mocknet require clean-up mn.SetLinkDefaults(mocknet.LinkOptions{