Repository navigation
test: modernize tests to use pytest - #2192
Conversation
912d942 to
7e97e86
Compare
365703d to
b8d22a3
Compare
814e8c7 to
fc77303
Compare
| MYSQL_PASSWORD: test | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "mysqladmin -uroot -p$${MYSQL_ROOT_PASSWORD} version"] | ||
| test: ["CMD-SHELL", "mysqladmin -h 127.0.0.1 -P 3306 -uroot -p$${MYSQL_ROOT_PASSWORD} ping"] |
There was a problem hiding this comment.
This was done due to some recurring timeout issues. Found that forcing the health check to use TCP instead and increasing the max retry fixed it.
mysqladmin version without -h 127.0.0.1 connects via Unix socket, not TCP. So the healthcheck passes (socket is ready) before port 3306 is accepting TCP connections. Seemed we were getting 'Connection refused' on TCP. This race exists in the MySQL e2e too, but that job has a lighter stack without the spanner emulator competing for resources, so MySQL is fully ready before syncserver even starts. With spanner 1.5.52 being heavier, everything starts simultaneously and hits the race, I think.
There was a problem hiding this comment.
I see some discussion of this here on this issue, so this makes sense. Let's apply it to the other couple mysql health checks in our compose files.
There's another comment there claiming a 3s timeout as being "crucial", who knows if that's true/still the case but we could also bump to that from our 2s as well.
There was a problem hiding this comment.
Yeah good call, I even bumped the postgres ones up by a second so it's 3s across the board, unless a reason not to. Wonder if some of the intermittent issues are at all related to this as that link gives pretty compelling reasons.
fc77303 to
2e4fdc5
Compare
| MYSQL_PASSWORD: test | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "mysqladmin -uroot -p$${MYSQL_ROOT_PASSWORD} version"] | ||
| test: ["CMD-SHELL", "mysqladmin -h 127.0.0.1 -P 3306 -uroot -p$${MYSQL_ROOT_PASSWORD} ping"] |
There was a problem hiding this comment.
I see some discussion of this here on this issue, so this makes sense. Let's apply it to the other couple mysql health checks in our compose files.
There's another comment there claiming a 3s timeout as being "crucial", who knows if that's true/still the case but we could also bump to that from our 2s as well.
| # This Source Code Form is subject to the terms of the Mozilla Public | ||
| # License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| # You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| """Fixtures and helpers for tokenserver integration tests. |
There was a problem hiding this comment.
This module replaces most of test_support.py I think, should that be killed now (or the non fixture functions could move there, but again I won't block on that)
There was a problem hiding this comment.
Let's land this if it's not a block and when I rebase with the large test_support and test_storage PR, I can remove that and/or move whatever standalone functions out
| FXA_METRICS_HASH_SECRET = os.environ.get("SYNC_MASTER_SECRET", "secret0") | ||
|
|
||
|
|
||
| # ── DB-mode helper ─────────────────────────────────────────────────────────── |
There was a problem hiding this comment.
FYI my preference would be to only keep fixtures in this file with the other functions living elsewhere but I won't block on that.
There was a problem hiding this comment.
Agreed, as above: let's land this if it's not a block and when I rebase with the large test_support and test_storage PR, I can remove that and/or move whatever standalone functions out.
3808203 to
6a913e6
Compare
Description
Our integration and e2e tests are a hodgepodge of class-based
unitTest(circa 2010 Python) and the newerpytest. This means we are leaving a lot of features on the table, like parallelized test runs and simpler maintenance with fixtures. This task updates our runs to usePytestfully.Testing
Our E2E & integration test runs
Issue(s)
Closes STOR-518.