-
Notifications
You must be signed in to change notification settings - Fork 23
Harden shared CI against transient failures #437
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?
Changes from all commits
7e3924e
3df1a73
44df562
206844c
284722c
96a4c4a
1202fd1
388e26f
3c0ee6a
a48915f
e4fc42f
19191cd
f9082f7
bdaa3d3
bc23f12
1f8bb93
3297cbe
c9971ce
3e87ecb
2215260
844061f
6258e21
7af67ce
5bb0cf2
576cf66
cb9faa6
7500249
03f02fd
83c2fbb
6fa5736
b12c651
4661a97
f33dca0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,7 +161,10 @@ func allocateTestNetworkLease(testName string, seq uint32) (*testNetworkLease, e | |
| return err | ||
| } | ||
|
|
||
| bridgeName = fmt.Sprintf("hm%04x%03x", testNetworkRunSeed&0xffff, seq%0xfff) | ||
| bridgeName, err = testBridgeNameForSubnet(subnet) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Orphan bridges can block subnetsMedium Severity Bridge names are now a fixed function of the leased subnet, but subnet selection only skips leases and overlapping routes. An orphan Additional Locations (2)Reviewed by Cursor Bugbot for commit 7e3924e. Configure here. |
||
| allocatedSubnet = subnet | ||
| leases[subnet] = subnetLease{ | ||
| TestName: testName, | ||
|
|
@@ -443,6 +446,34 @@ func pruneStaleLeases(leases map[string]subnetLease, routes []hostRoute) { | |
| } | ||
| } | ||
|
|
||
| func testBridgeNameForSubnet(subnet string) (string, error) { | ||
| ip, _, err := net.ParseCIDR(subnet) | ||
| if err != nil { | ||
| return "", fmt.Errorf("parse test subnet %q: %w", subnet, err) | ||
| } | ||
| ip = ip.To4() | ||
| if ip == nil { | ||
| return "", fmt.Errorf("test subnet %q is not IPv4", subnet) | ||
| } | ||
| return fmt.Sprintf("hm%02x%02x", ip[1], ip[2]), nil | ||
| } | ||
|
|
||
| func TestBridgeNameForTestSubnet(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| first, err := testBridgeNameForSubnet("10.200.1.0/24") | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| second, err := testBridgeNameForSubnet("10.200.2.0/24") | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| if first != "hmc801" || second != "hmc802" || first == second { | ||
|
Comment on lines
+461
to
+472
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks like it's just trying two options but that would only decrease but not resolve the issue |
||
| t.Fatalf("unexpected bridge names: %q %q", first, second) | ||
| } | ||
| } | ||
|
|
||
| func bridgeExists(name string) bool { | ||
| if name == "" { | ||
| return false | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.