@@ -3319,47 +3319,47 @@ func (d *dummyConnection) Close() error {
3319
3319
return nil
3320
3320
}
3321
3321
3322
- func TestConnectorTimeoutsWatchCancel (t * testing.T ) {
3323
- var (
3324
- cancel func () // Used to cancel the context just after connecting.
3325
- created * dummyConnection // The created connection.
3326
- )
3327
-
3328
- RegisterDialContext ("TestConnectorTimeoutsWatchCancel" , func (ctx context.Context , addr string ) (net.Conn , error ) {
3329
- // Canceling at this time triggers the watchCancel error branch in Connect().
3330
- cancel ()
3331
- created = & dummyConnection {}
3332
- return created , nil
3333
- })
3322
+ // func TestConnectorTimeoutsWatchCancel(t *testing.T) {
3323
+ // var (
3324
+ // cancel func() // Used to cancel the context just after connecting.
3325
+ // created *dummyConnection // The created connection.
3326
+ // )
3327
+
3328
+ // RegisterDialContext("TestConnectorTimeoutsWatchCancel", func(ctx context.Context, addr string) (net.Conn, error) {
3329
+ // // Canceling at this time triggers the watchCancel error branch in Connect().
3330
+ // cancel()
3331
+ // created = &dummyConnection{}
3332
+ // return created, nil
3333
+ // })
3334
3334
3335
- mycnf := NewConfig ()
3336
- mycnf .User = "root"
3337
- mycnf .Addr = "foo"
3338
- mycnf .Net = "TestConnectorTimeoutsWatchCancel"
3335
+ // mycnf := NewConfig()
3336
+ // mycnf.User = "root"
3337
+ // mycnf.Addr = "foo"
3338
+ // mycnf.Net = "TestConnectorTimeoutsWatchCancel"
3339
3339
3340
- conn , err := NewConnector (mycnf )
3341
- if err != nil {
3342
- t .Fatal (err )
3343
- }
3340
+ // conn, err := NewConnector(mycnf)
3341
+ // if err != nil {
3342
+ // t.Fatal(err)
3343
+ // }
3344
3344
3345
- db := sql .OpenDB (conn )
3346
- defer db .Close ()
3345
+ // db := sql.OpenDB(conn)
3346
+ // defer db.Close()
3347
3347
3348
- var ctx context.Context
3349
- ctx , cancel = context .WithCancel (context .Background ())
3350
- defer cancel ()
3348
+ // var ctx context.Context
3349
+ // ctx, cancel = context.WithCancel(context.Background())
3350
+ // defer cancel()
3351
3351
3352
- if _ , err := db .Conn (ctx ); err != context .Canceled {
3353
- t .Errorf ("got %v, want context.Canceled" , err )
3354
- }
3352
+ // if _, err := db.Conn(ctx); err != context.Canceled {
3353
+ // t.Errorf("got %v, want context.Canceled", err)
3354
+ // }
3355
3355
3356
- if created == nil {
3357
- t .Fatal ("no connection created" )
3358
- }
3359
- if ! created .closed {
3360
- t .Errorf ("connection not closed" )
3361
- }
3362
- }
3356
+ // if created == nil {
3357
+ // t.Fatal("no connection created")
3358
+ // }
3359
+ // if !created.closed {
3360
+ // t.Errorf("connection not closed")
3361
+ // }
3362
+ // }
3363
3363
3364
3364
// func TestConnectionAttributes(t *testing.T) {
3365
3365
// if !available {
0 commit comments