Skip to content

Use sandboxed spawn strategy in testing - #291

Draft
furtib wants to merge 1 commit into
Ericsson:mainfrom
furtib:use_sandboxed_for_testing
Draft

Use sandboxed spawn strategy in testing#291
furtib wants to merge 1 commit into
Ericsson:mainfrom
furtib:use_sandboxed_for_testing

Conversation

@furtib

@furtib furtib commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Why:
The spawn_strategy=sandboxed is a much stricter testing environment. It can catch issues that can go unnoticed in some cases. (For example, setting the workaround PATH for codechecker to / works without this flag, even though it shouldn't.)
This strategy more closely mimics the restrictions of a remote worker.

What:

  • Added the flag --spawn_strategy=sandboxed to CI tests. (Had to skip Buildifier since the sandboxed strategy is too restrictive for it.)
  • Added a tag to Buildifier. (So that I can skip it.)
  • Removed local = True from unit_test macro. (This flag prevents these kinds of tests from running with a sandboxed strategy.)

Notes:
This strategy may restrict what kind of tests we can use.

Addresses:
None

@furtib
furtib requested a review from Szelethus August 14, 2026 07:05
@furtib furtib self-assigned this Aug 14, 2026
@furtib furtib added the CI 📦 label Aug 14, 2026
@furtib
furtib marked this pull request as draft August 14, 2026 07:49
@nettle

nettle commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

This is actually interesting idea!
However, I think we should be careful with this option - its behavior is changing in time and the logic is not that plain as it seems.
I would suggest running it as a separate test so far in addition to default strategy to compare results.

@furtib

furtib commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

I also found that it's not that simple. Despite my suspicion that networking is disabled inside the sandboxed version, testing it on the Bazel native FOSS test branch (#235) (after removing local=true), the tests passed.
I also had my doubts about whether Bazel inside Bazel calls inside the sandbox are possible, but surprisingly they also worked.

If we add this as a second test, should we require that all tests pass this way too, or do you think that would be too flaky?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants