Commit Graph

22 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews 56d581613c
Update test/config. (#4923)
This copies over a number of features flags and other settings from
test/config-next that have been applied in prod.

Also, remove the config-next gate on various tests.
2020-07-01 17:59:14 -07:00
Daniel McCarney fc15f2f4cd
SA: add unit test for auto_increment schemas. (#4586)
* SA: add unit test for auto_increment schemas.

`TestAutoIncrementSchema` uses a root user connection to the
`information_schema` MariaDB database to try and find table columns from
the Boulder schemas that are both `auto_increment` and not `int64`.

* SA: rename _db-next RemoveOCSPResponses.sql migration.

Based on the order that we apply migrations the
`RemoveOCSPResponses.sql` migration with its old prefix
(`20181101105733`) was never being applied. That in turn caused the new
`TestAutoIncrementSchema` unit test to fail because the old
`ocspResponses` table has an `id` field that is `auto_increment` but
`sized `int(11)`.

Renaming the migration with a newer prefix solves the problem. The
`ocspResponses` table ends up dropped when `config-next` is used.
Afterwards the `TestAutoIncrementSchema` unit test passes again.
2019-12-02 11:33:36 -05:00
Roland Bracewell Shoemaker a44f346f88 SA: remove old authorization tables from the schema (#4538) 2019-11-11 16:17:16 -05:00
Jacob Hoffman-Andrews 9fda3fb77d Switch to DSNs (#4044)
* Switch to DSNs

We used to use "mysql+tcp://" URLs but we don't need those anymore,
and there aren't any more of them in prod.

* Fix test.
2019-02-11 10:46:07 -08:00
Jeff Hodges b88750ede0 remove prefixdb and replace with mysql driver params (#2871)
This uses the mysql driver library's capability to use `SET` to set the system
variables that prefixdb previously was.

Unfortunately, the library doesn't sort the params when making the string, so we
have to do a little munging to TestNewDbMap.

Ran it in a checkout of the repo since godeps now doesn't include the test files (which is great!).

```
MYSQL_TEST_ADDR=127.0.0.1:3306 go test .
ok  	github.com/go-sql-driver/mysql	46.099s
```
2017-07-17 16:40:56 -07:00
Jacob Hoffman-Andrews d47d3c5066 Recycle pending authorizations (#2797)
If the feature flag "ReusePendingAuthz" is enabled, a request to create a new authorization object from an account that already has a pending authorization object for the same identifier will return the already-existing authorization object. This should make it less common for people to get stuck in the "too many pending authorizations" state, and reduce DB storage growth.

Fixes #2768
2017-06-19 13:35:36 -04:00
Jacob Hoffman-Andrews dcbe7e0895 Increase readTimeout in TestTimeouts. (#2671)
Should decrease flakiness in this test. Fixes #2564
2017-04-09 15:32:02 -04:00
Jacob Hoffman-Andrews 5f1919b40f Use max_statement_time for timeouts. (#2263)
This means that we get a more useful log message for slow queries, and don't
need to close the MySQL connection. It also means that the query is actually
killed on the MySQL side, rather than just timing out and returning on the
client side.

We set the max_statement_time to 95% of the `readTimeout`.

Also set the `long_query_time` to 80% of the `readTimeout`, so that queries that are
close to timing out will be logged by MySQL's slow query logging.
2016-10-20 10:29:29 -04:00
Jacob Hoffman-Andrews 19da2be7ef Set STRICT_ALL_TABLES when setting up DB (#1890)
Fixes #1202.
2016-06-06 13:48:16 -07:00
Roland Bracewell Shoemaker 54573b36ba Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
Jacob Hoffman-Andrews b3bc3d8e41 Add a MaxDBConns config parameter. (#1793) 2016-05-09 14:21:15 -07:00
Igor Bukanov 7b14242079 always use boulder-mysql, not localhost, for mysql
This followup for #1639 to always use the boulder-mysql, not localhost, when connecting to mysql database when testing.
2016-04-07 10:19:24 +02:00
Kane York 21700ffec5 Improve mocks.Mailer to check To: line 2016-03-14 17:08:44 -07:00
Kane York f440380330 sa: use mysql.Config to set flags on connect strings
This also exposes an interface to open a connection using a
mysql.Config, so we can start changing config files to use those.

Part of #1505
2016-02-29 15:38:43 -08:00
Jeff Hodges 5e97aa23c6 use MariaDB in the unit tests
And delete the uses of sqlite3
2015-08-14 17:13:15 -07:00
Roland Shoemaker df179a1dde Review fixes 2015-07-29 12:17:04 -07:00
Roland Shoemaker 3a5f96c9e1 Remove debug statement 2015-07-28 10:33:26 -07:00
Roland Shoemaker 33a79c3910 Pull out previous parseTime check 2015-07-27 17:57:14 -07:00
Jeff Hodges 79d9b52ad0 rename dbName to dbConnect
The configuration is actually a connection string, not a database name,
and it was a bit confusing.
2015-07-10 16:17:27 -07:00
Richard Barnes 9bd9ed08da Change from adding the parameter to enforcing it 2015-06-23 23:18:45 -07:00
J.C. Jones ef0e7fd3f6 New tests
- Write a database.go test
 - Start writing a type-converter.go test
2015-06-11 17:29:38 -05:00
J.C. Jones af0f8446eb Issue #202, Periodic OCSP Signer Tool
- Move dbMap construction and type converter into individual files in the sa package.
- Add DB configuration for the OCSP tool to the boulder config:
  - left to the user if they want to use different boulder-config.json files
    for different purposes.
- Added updater to Makefile
- Fix trailing ',' in the Boulder config, add more panic logging
- Ignore .pem files produced by the integration test
- Change RPC to use per-instance named reply-to queues.
- Finish OCSP Updater logic
- Rework RPC for OCSP to use a transfer object (due to serialization problems of x509.Certificate)
2015-05-27 22:01:29 -07:00