Skip to content

Commit 36b9eb3

Browse files
committed
Review feedback
1 parent 5ce8741 commit 36b9eb3

6 files changed

Lines changed: 18 additions & 21 deletions

File tree

sa/vtschema/boulder_sa/vschema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"certificateStatus": { "column_vindexes": [ { "column": "serial", "name": "xxhash" } ] },
1212
"certificates": { "column_vindexes": [ { "column": "serial", "name": "xxhash" } ] },
1313
"crlShards": { "column_vindexes": [ { "column": "issuerID", "name": "xxhash" } ] },
14-
"crls": { "column_vindexes": [ { "column": "serials", "name": "xxhash" } ] },
14+
"crls": { "column_vindexes": [ { "column": "serial", "name": "xxhash" } ] },
1515
"fqdnSets": { "column_vindexes": [ { "column": "id", "name": "xxhash" } ] },
1616
"incidents": { "column_vindexes": [ { "column": "id", "name": "xxhash" } ] },
1717
"issuedNames": { "column_vindexes": [ { "column": "id", "name": "xxhash" } ] },

sa/vtschema/boulder_sa_next/vschema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"certificateStatus": { "column_vindexes": [ { "column": "serial", "name": "xxhash" } ] },
1212
"certificates": { "column_vindexes": [ { "column": "serial", "name": "xxhash" } ] },
1313
"crlShards": { "column_vindexes": [ { "column": "issuerID", "name": "xxhash" } ] },
14-
"crls": { "column_vindexes": [ { "column": "serials", "name": "xxhash" } ] },
14+
"crls": { "column_vindexes": [ { "column": "serial", "name": "xxhash" } ] },
1515
"fqdnSets": { "column_vindexes": [ { "column": "id", "name": "xxhash" } ] },
1616
"incidents": { "column_vindexes": [ { "column": "id", "name": "xxhash" } ] },
1717
"issuedNames": { "column_vindexes": [ { "column": "id", "name": "xxhash" } ] },

test/db.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,15 @@ type CleanUpDB interface {
2323
}
2424

2525
// ResetBoulderTestDatabase returns a cleanup function which deletes all rows in
26-
// all tables of the 'boulder_sa' database. Omits the 'gorp_migrations'
27-
// table as this is used by sql-migrate (https://github.com/rubenv/sql-migrate)
28-
// to track migrations. If it encounters an error it fails the tests.
26+
// all tables of the 'boulder_sa' database.
27+
// If it encounters an error it fails the tests.
2928
func ResetBoulderTestDatabase(t testing.TB) func() {
3029
return resetTestDatabase(t, context.Background(), vars.DBConnSAFullPerms)
3130
}
3231

3332
// ResetIncidentsTestDatabase returns a cleanup function which deletes all rows
34-
// in all tables of the 'incidents_sa' database. Omits the
35-
// 'gorp_migrations' table as this is used by sql-migrate
36-
// (https://github.com/rubenv/sql-migrate) to track migrations. If it encounters
37-
// an error it fails the tests.
33+
// in all tables of the 'incidents_sa' database.
34+
// If it encounters an error it fails the tests.
3835
func ResetIncidentsTestDatabase(t testing.TB) func() {
3936
return resetTestDatabase(t, context.Background(), vars.DBConnIncidentsFullPerms)
4037
}
@@ -86,10 +83,9 @@ func deleteEverythingInAllTables(ctx context.Context, db CleanUpDB) error {
8683
}
8784

8885
// allTableNamesInDB returns the names of the tables available to the passed
89-
// CleanUpDB. Omits the 'gorp_migrations' table as this is used by sql-migrate
90-
// (https://github.com/rubenv/sql-migrate) to track migrations.
86+
// CleanUpDB.
9187
func allTableNamesInDB(ctx context.Context, db CleanUpDB) ([]string, error) {
92-
r, err := db.QueryContext(ctx, "select table_name from information_schema.tables t where t.table_schema = DATABASE() and t.table_name != 'gorp_migrations';")
88+
r, err := db.QueryContext(ctx, "select table_name from information_schema.tables t where t.table_schema = DATABASE();")
9389
if err != nil {
9490
return nil, err
9591
}

test/integration/revocation_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,16 @@ func TestRevocation(t *testing.T) {
383383
type revocationCheck func(t *testing.T, allCRLs map[string][]*x509.RevocationList)
384384
var revocationChecks []revocationCheck
385385
var rcMu sync.Mutex
386-
var wg sync.WaitGroup
387386

388387
for _, kind := range []certKind{precert, finalcert} {
389388
for _, reason := range []revocation.Reason{revocation.Unspecified, revocation.KeyCompromise, revocation.Superseded} {
389+
// We only schedule four work items at a time because vttestserver only supports 4 concurrent transactions.
390+
// If there are more than that, they will hang, timeout, and error.
391+
// Specifically, vttestserver runs vtcomboserver with --queryserver-config-transaction-cap 4 and has no
392+
// way (as of v23.0) to override it.
393+
var wg sync.WaitGroup
390394
for _, method := range []authMethod{byAccount, byAuth, byKey, byAdmin} {
391-
wg.Add(1)
392-
go func() {
393-
defer wg.Done()
395+
wg.Go(func() {
394396
cert := issueAndRevoke(testCase{
395397
method: method,
396398
reason: reason,
@@ -424,7 +426,7 @@ func TestRevocation(t *testing.T) {
424426
rcMu.Lock()
425427
revocationChecks = append(revocationChecks, check)
426428
rcMu.Unlock()
427-
}()
429+
})
428430
}
429431
wg.Wait()
430432
}

test/vars/vars.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ func dsn(user, database string) string {
1010
if addr == "" {
1111
addr = "unset DB_ADDR"
1212
}
13-
config_variant := ""
13+
configVariant := ""
1414
if os.Getenv("BOULDER_CONFIG_DIR") == "test/config-next" && database != "information_schema" {
15-
config_variant = "_next"
15+
configVariant = "_next"
1616
}
17-
return fmt.Sprintf("%s@tcp(%s)/%s%s", user, addr, database, config_variant)
17+
return fmt.Sprintf("%s@tcp(%s)/%s%s", user, addr, database, configVariant)
1818
}
1919

2020
var (

test/vtcomboserver/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ RUN go build -trimpath -o /out/vtcombo ./go/cmd/vtcombo
2828
RUN go build -trimpath -o /out/vtexplain ./go/cmd/vtexplain
2929
RUN go build -trimpath -o /out/mysqlctl ./go/cmd/mysqlctl
3030

31-
3231
FROM ${MYSQL_BASE_IMAGE} AS runtime
3332

3433
# Vitess expects to run as a non-root user

0 commit comments

Comments
 (0)