File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,8 @@ WITH into_db = 'defaultdb', unsafe_restore_incompatible_version;
194194 stmt := ""
195195 err := func () error {
196196 done := make (chan error , 1 )
197- go func (context.Context ) {
197+ m := c .NewMonitor (ctx , c .Node (1 ))
198+ m .Go (func (context.Context ) error {
198199 // Generate can potentially panic in bad cases, so
199200 // to avoid Go routines from dying we are going
200201 // catch that here, and only pass the error into
@@ -210,7 +211,7 @@ WITH into_db = 'defaultdb', unsafe_restore_incompatible_version;
210211 if stmt == "" {
211212 // If an empty statement is generated, then ignore it.
212213 done <- errors .Newf ("Empty statement returned by generate" )
213- return
214+ return nil
214215 }
215216
216217 // TODO(yuzefovich): investigate why using the context with
@@ -225,7 +226,9 @@ WITH into_db = 'defaultdb', unsafe_restore_incompatible_version;
225226 }
226227 }
227228 done <- err
228- }(ctx )
229+ return nil
230+ })
231+ defer m .Wait ()
229232 select {
230233 case <- time .After (timeout * 2 ):
231234 // SQLSmith generates queries that either perform full table scans of
You can’t perform that action at this time.
0 commit comments