Skip to content

Commit d3a7269

Browse files
committed
always reset auto-increment in tests
Fixes letsencrypt#1431 which unblocks the test failures in CI.
1 parent 541b858 commit d3a7269

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/db.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ func deleteEverythingInAllTables(db CleanUpDB) error {
7070
// rejecting the DELETE for not having a WHERE clause.
7171
_, err := db.Exec("delete from `" + tn + "` where 1 = 1")
7272
if err != nil {
73-
return err
73+
return fmt.Errorf("unable to delete all rows from table %#v: %s", tn, err)
74+
}
75+
_, err = db.Exec("alter table `" + tn + "` AUTO_INCREMENT = 1")
76+
if err != nil {
77+
return fmt.Errorf("unable to reset autoincrement on table %#v: %s", tn, err)
7478
}
7579
}
7680
return err

0 commit comments

Comments
 (0)