Skip to content

[v2] Fix TestCreateTempURL flaky test by removing hardcoded port dependency - #3692

Merged
stephenfin merged 2 commits into
gophercloud:v2from
shiftstack:tempurl-fix-v2
Apr 7, 2026
Merged

stephenfin merged 2 commits into
gophercloud:v2from
shiftstack:tempurl-fix-v2

Conversation

@mandre

@mandre mandre commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

SetupPersistentPortHTTP used t.Errorf on bind failure, which didn't stop
execution and caused a nil pointer panic on server.Start(). Changed to
t.Fatalf to fail cleanly.

Replaced SetupPersistentPortHTTP with SetupHTTP in objectstorage temp URL
tests since the HMAC signature only covers the path, not the host:port.
This eliminates the flaky port-already-in-use failures in CI.

Manual backport of #3662.

mandre added 2 commits April 7, 2026 18:10
SetupPersistentPortHTTP used t.Errorf on bind failure, which didn't stop
execution and caused a nil pointer panic on server.Start(). Changed to
t.Fatalf to fail cleanly.

Replaced SetupPersistentPortHTTP with SetupHTTP in objectstorage temp URL
tests since the HMAC signature only covers the path, not the host:port.
This eliminates the flaky port-already-in-use failures in CI.

Fixes gophercloud#3661.
… tests

Several tests used t.Errorf after fallible operations, which logs the
error but doesn't stop execution. This caused nil pointer dereferences
when subsequent code accessed the result. Replace with th.AssertNoErr
which calls t.Fatal internally, stopping the test immediately on error.
@github-actions github-actions Bot added v2 This PR targets v2 edit:objectstorage This PR updates objectstorage code edit:sharedfilesystems This PR updates sharedfilesystems code edit:identity This PR updates identity code edit:testinfra This PR updates testing infrastructure code semver:patch No API change labels Apr 7, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 63.756%. remained the same — shiftstack:tempurl-fix-v2 into gophercloud:v2

@stephenfin
stephenfin merged commit e2a36a1 into gophercloud:v2 Apr 7, 2026
21 checks passed
@stephenfin
stephenfin deleted the tempurl-fix-v2 branch April 7, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

edit:identity This PR updates identity code edit:objectstorage This PR updates objectstorage code edit:sharedfilesystems This PR updates sharedfilesystems code edit:testinfra This PR updates testing infrastructure code semver:patch No API change v2 This PR targets v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants