-
Notifications
You must be signed in to change notification settings - Fork 275
fix(tests): Re-enable MQTT and Postgres tests #3163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(tests): Re-enable MQTT and Postgres tests #3163
Conversation
b7c00c1
to
3913626
Compare
We had a pass - I kicked off a re-run to see if we can get a flake |
9031f2a
to
fa3e779
Compare
@itowlson I've squashed all necessary changes. For context, all previous runs of all-integration-tests were executed on ubuntu-latest, which allowed them to run on my fork's PRs. However, I've now switched it back to the custom Spin runner. |
Excellent, thanks! Sorry for the slow turmarounds here, it's making me manually approve each re-run, but I will try to stay across it. |
Everything is in place and all the tests pass, waiting for your review @itowlson |
Thank you @PhantomInTheWire! I'm planning to re-run the CI a few times to see if the flakes re-appear, so please don't worry if things go back to 'running.' I'll take a look at the changes in the meantime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for looking into this! It all looks good to me but there's a couple of things I'd like to undestand, and I really want to get feedback from @rylev as well. But fingers crossed that you've cracked it...!
@@ -14,5 +14,5 @@ component = "test" | |||
|
|||
[component.test] | |||
source = "%{source=outbound-postgres}" | |||
allowed_outbound_hosts = ["postgres://{{ pg_host }}:%{port=5432}"] | |||
environment = { DB_URL = "postgres://postgres:postgres@localhost:%{port=5432}/spin_dev" } | |||
allowed_outbound_hosts = ["postgres://{{ pg_host }}:5432"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the changes away from placeholder ports needed? I believe we did this so that test instances could be brought up on ports determined at runtime, and it would be good to keep it. If it's not working, it would be good to understand why. (But if that's involved in the flakiness, we can probably punt on it for now.) cc @rylev for thoughts and insight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaving the placeholder ports in place causes a runtime failure. Specifically, the test fails with:
postgres::Connection::open(&address) errored: 'Error::ConnectionFailed("error communicating with the server: Connection reset by peer (os error 54)")'
This happens sometimes unless a fixed port is provided, the dynamic port allocation logic isn’t working reliably in this test/ci context. We could dig deeper into why, but for now, hardcoding the port makes the test pass deterministically.
@@ -191,6 +191,20 @@ jobs: | |||
# run on a larger runner for more SSD/resource access | |||
runs-on: ubuntu-22.04-4core-spin | |||
if: ${{ github.repository_owner == 'spinframework' }} | |||
services: | |||
postgres: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I thought we were dockerising the Postgres instance, but maybe that's been part of the problem. Again, I'd like to get Ryan's input on making it part of the CI image instead (I'm not for or against it, I just want to hear from someone who knows this bit of the system better than I do!).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i think it was not dockerising it right in ci environments, i think it's the same problem with mqtt too, hence the hardcoded service
Bother, that's a flake in MQTT. I saw you updated the settings for Postgres; do you think something similar needs to be done for MQTT? |
yeah this is my first time encountering it I think adding a mqtt service to build.yml might fix it but let me try and see if i can figure it out |
f1d22de
to
a1266b6
Compare
Update: I attempted to reproduce the flake on a fork using the ubuntu-latest runner (link), running 20 jobs concurrently across multiple attempts but couldn’t trigger the issue(it did fail once on run # 2 but that was integration_tests::bad_build_test not mqtt). Could you share how the custom Spin runner is configured? I think that could be a reason |
fa3e779
to
01fc86f
Compare
Hmm, I don't think I have access to the custom large runner configuration. @spinframework/org-admin can one of you folks help out here? |
b0278f8
to
e9a0850
Compare
Signed-off-by: Karan <[email protected]>
e9a0850
to
878fa5e
Compare
This PR re-enables the previously ignored
outbound-postgres
andoutbound-postgres-variable-permission
tests. It also fixes their flakiness.fixes: #2907
high-level changes: