Skip to content

test: fix TestNetworkAliases, fixes #7657 - #7658

Merged
rfay merged 7 commits into
mainfrom
20250924_stasadev_test_network_aliases
Sep 24, 2025
Merged

rfay merged 7 commits into
mainfrom
20250924_stasadev_test_network_aliases

Conversation

@stasadev

@stasadev stasadev commented Sep 24, 2025 •

Copy link
Copy Markdown
Member

The Issue

How This PR Solves The Issue

  • Uses require instead of assert for network tests
  • Fixes assign for app1 and app2 - that's why tests failed sometimes
  • Runs TestNetworkAliases everywhere, I don't think that we can get "connection reset by peer" inside containers.

Manual Testing Instructions

Automated Testing Overview

Release/Deployment Notes

@github-actions

github-actions Bot commented Sep 24, 2025 •

Copy link
Copy Markdown

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks OK to me. As you know, I've converted to require everywhere because I don't want to see output after a failure, just chase the first failure. I'm not sure why use assertions in t.Cleanup() since the error would be unexpected and probably indicate a real problem anyway. So I usually either ignore failures there or require() instead.

@stasadev stasadev changed the title test: use require instead of assert for network tests, for #7657 test: use require instead of assert for network tests, fixes #7657 Sep 24, 2025
@stasadev stasadev changed the title test: use require instead of assert for network tests, fixes #7657 test: fix TestNetworkAliases, fixes #7657 Sep 24, 2025
@stasadev

Copy link
Copy Markdown
Member Author

Looking at TestInternalAndExternalAccessToURL, I realized that we needed more waiting time after ddev start as in that test.

So this is most likely a problem with the test, and not with DDEV logic.

@rfay

rfay commented Sep 24, 2025

Copy link
Copy Markdown
Member

Normally ddev start finishes everything; mutagen sync is complete when app.Start() finishes.

Comment on lines -231 to -232
if len(apps) >= 2 {
app1, app2 = apps[0], apps[1]

@stasadev stasadev Sep 24, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found out what was wrong: sometimes app1 was actually app2, that's why Traefik failed with 404, because there was nothing running on that port.

Incorrect order = failed checks.

@stasadev
stasadev marked this pull request as ready for review September 24, 2025 19:36
@stasadev
stasadev requested a review from a team as a code owner September 24, 2025 19:36

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, congrats!

@rfay
rfay merged commit 4d1a1c0 into main Sep 24, 2025
@rfay
rfay deleted the 20250924_stasadev_test_network_aliases branch September 24, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants