Skip to content

test: remove 'unparallel' build tag in favor of testutils helper#44304

Merged
ti-mo merged 8 commits intocilium:mainfrom
ti-mo:tb/remove-unparallel-build-tag
Mar 11, 2026
Merged

test: remove 'unparallel' build tag in favor of testutils helper#44304
ti-mo merged 8 commits intocilium:mainfrom
ti-mo:tb/remove-unparallel-build-tag

Conversation

@ti-mo
Copy link
Copy Markdown
Contributor

@ti-mo ti-mo commented Feb 11, 2026

  • Remove the 'unparallel' build tag
  • Add a linter rejecting anything other than built-in linux/darwin/windows/race tags in tests
  • Namespace node tests
  • Namespace ipsec tests
  • Remove bitrotted node benchmarks

Let's avoid regressing in the future, please.

Node and ipsec tests no longer have any side effects in the host netns.

Fixes #42182.

  • Try removing SerializedTest() altogether. We should be able to reason about tests' side effects. Considering adding an import side effect to package testutils/netns to set net.core.fb_tunnels_only_for_init_net=2. It's a backwards-compat measure, not sane behaviour IMO. Then namespaced tests get clean environments out of the box, and there's no risk of new modules getting loaded before netns creation.
Remove 'unparallel' build tag to restore editor tooling functionality

@ti-mo ti-mo added the release-note/ci This PR makes changes to the CI. label Feb 11, 2026
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Feb 11, 2026

/test

@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Feb 11, 2026

/test

@ti-mo ti-mo marked this pull request as ready for review February 11, 2026 22:11
@ti-mo ti-mo requested review from a team as code owners February 11, 2026 22:11
Copy link
Copy Markdown
Member

@bimmlerd bimmlerd left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fighting build tags Timo 🙇

@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 4, 2026

/test

1 similar comment
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 4, 2026

/test

@ti-mo ti-mo marked this pull request as draft March 9, 2026 23:25
@ti-mo ti-mo force-pushed the tb/remove-unparallel-build-tag branch from 67d6bbe to 4059666 Compare March 9, 2026 23:29
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 9, 2026

/test

@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 10, 2026

/ci-runtime

@ti-mo ti-mo force-pushed the tb/remove-unparallel-build-tag branch from 4059666 to 892771e Compare March 10, 2026 12:33
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 10, 2026

/test

@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 10, 2026

/ci-runtime

@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 10, 2026

/test

@ti-mo ti-mo marked this pull request as ready for review March 10, 2026 14:11
Copy link
Copy Markdown
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

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

LGTM

ti-mo added 8 commits March 11, 2026 09:14
On main, these are currently failing with errors like:

```
logger.go:256: time=2026-03-09T23:29:19.121+01:00 level=ERROR source=/home/cilium/cilium/pkg/datapath/linux/node_ids.go:148 msg="Failed to map node IP address to allocated ID" error="invalid node IP <nil>: ParseAddr(\"<nil>\"): unable to parse IP" nodeID=39855 ipAddr=<nil> spi=0
```

The recent change to netip for IP addresses broke these, and it's clear they
haven't been actively maintained, extended or exercised in a while. If we care
about them, we should execute them in CI. Also, the structure is a bit of
a mess, so I propose to get rid of them to ease maintenance.

Signed-off-by: Timo Beckers <timo@isovalent.com>
Since multiple parts of the code couldn't agree on what to do with fb_tunnels,
this commit standardizes on always setting it to 2, as well as managing it
through an import side effect to make sure it runs as early during test
execution as possible. This reduces the risk of tests loading kernel modules
before setting the sysctl. It's tied to the netns package because that's when
it usually becomes a problem: creating netns and not getting a clean
environment.

The tests for renaming fallback devices to cilium_tunl and cilium_ip6tnl were
removed as the behaviour in question isn't load-bearing and the Cilium agent
itself now also defaults to setting fb_tunnels to 2.

Signed-off-by: Timo Beckers <timo@isovalent.com>
We've gone through great lengths to avoid using build tags in tests since it
messes with editor tooling, code completion, go-to reference, and notably
excludes files from golangci-lint.

Remove the 'unparallel' build tag.

Signed-off-by: Timo Beckers <timo@isovalent.com>
Another footgun of build tags in tests: code is obscured from linters as well.

Signed-off-by: Timo Beckers <timo@isovalent.com>
This commit gives the node tests some long-overdue attention:

- All tests get their own netns; this file has been a frequent source of
  test concurrency bugs/interference
- Add test helpers for often-repeated statements that should never fail
- Minimize the 'suite' concept and reduce its verbosity
- Remove teardown logic; let the kernel take care of this
- Introduced the testutils/netlink package for common netlink-related test helpers

Signed-off-by: Timo Beckers <timo@isovalent.com>
Suggested-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
What it says on the tin, this commit removes some footguns, only runs tests as
privileged when needed, uses test helpers, and gets rid of the 'suite'
mechanism in favor of simple subtest loops.

Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
We've spent considerable effort so far avoiding using build tags in tests
to make tooling play nice, keeping the dev experience smooth and friction
to a minimum. It's unfortunate that we've regressed, so add a linter to make
sure this doesn't happen again without being raised with committers.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo force-pushed the tb/remove-unparallel-build-tag branch from 892771e to 0c2d4d6 Compare March 11, 2026 08:16
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 11, 2026

/test

1 similar comment
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Mar 11, 2026

/test

@ti-mo ti-mo added this pull request to the merge queue Mar 11, 2026
Merged via the queue into cilium:main with commit c43d531 Mar 11, 2026
79 checks passed
@ti-mo ti-mo deleted the tb/remove-unparallel-build-tag branch March 11, 2026 09:46
@maintainer-s-little-helper maintainer-s-little-helper bot added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: TestPrivilegedAll/IPv6/TestNodePodCIDRsChurnIPSec

8 participants