| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1f9cef2 commit ccc6359
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,7 @@ import ( | |||
| 23 | 23 | "testing" | |
| 24 | 24 | "time" | |
| 25 | 25 | ||
| 26 | + bp "github.com/CovenantSQL/CovenantSQL/blockproducer" | ||
| 26 | 27 | "github.com/CovenantSQL/CovenantSQL/crypto" | |
| 27 | 28 | "github.com/CovenantSQL/CovenantSQL/crypto/asymmetric" | |
| 28 | 29 | "github.com/CovenantSQL/CovenantSQL/crypto/kms" | |
@@ -68,10 +69,13 @@ func TestCreate(t *testing.T) { | |||
| 68 | 69 | var dsn string | |
| 69 | 70 | dsn, err = Create(ResourceMeta{}) | |
| 70 | 71 | So(err, ShouldBeNil) | |
| 72 | + dsnCfg, err := ParseDSN(dsn) | ||
| 73 | + So(err, ShouldBeNil) | ||
| 71 | 74 | ||
| 72 | 75 | waitCtx, cancelWait := context.WithTimeout(context.Background(), time.Nanosecond) | |
| 73 | 76 | defer cancelWait() | |
| 74 | - err = WaitDBCreation(waitCtx, dsn) | ||
| 77 | + // should not use client.WaitDBCreation, sql.Open is not supported in this test case | ||
| 78 | + err = bp.WaitDatabaseCreation(waitCtx, proto.DatabaseID(dsnCfg.DatabaseID), nil, 3*time.Second) | ||
| 75 | 79 | So(err, ShouldResemble, context.DeadlineExceeded) | |
| 76 | 80 | ||
| 77 | 81 | // Calculate database ID | |
@@ -92,7 +96,8 @@ func TestCreate(t *testing.T) { | |||
| 92 | 96 | ||
| 93 | 97 | waitCtx2, cancelWait2 := context.WithTimeout(context.Background(), 5*time.Minute) | |
| 94 | 98 | defer cancelWait2() | |
| 95 | - err = WaitDBCreation(waitCtx2, dsn) | ||
| 99 | + // should not use client.WaitDBCreation, sql.Open is not supported in this test case | ||
| 100 | + err = bp.WaitDatabaseCreation(waitCtx2, proto.DatabaseID(dsnCfg.DatabaseID), nil, 3*time.Second) | ||
| 96 | 101 | So(err, ShouldBeNil) | |
| 97 | 102 | }) | |
| 98 | 103 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -304,9 +304,6 @@ func TestFullProcess(t *testing.T) { | |||
| 304 | 304 | err = client.WaitDBCreation(ctx2, dsn) | |
| 305 | 305 | So(err, ShouldBeNil) | |
| 306 | 306 | ||
| 307 | - _, err = db.ExecContext(ctx2, "SHOW TABLES") | ||
| 308 | - So(err, ShouldBeNil) | ||
| 309 | - | ||
| 310 | 307 | _, err = db.Exec("CREATE TABLE test (test int)") | |
| 311 | 308 | So(err, ShouldBeNil) | |
| 312 | 309 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments