Repository navigation
Description
🔴 Required Information
Describe the Bug:
13 tests in tests/unittests/integrations/vmaas/test_agent_engine_environment.py fail on macOS. The test's fake sandbox runs the commands that AgentEngineEnvironment sends to the (Linux) sandbox in a local bash. Since the chunked large-file read/write changes on 2026-10-27 (4c88040, 5843c58), those commands use GNU coreutils options that the BSD tools on macOS don't accept. CI runs only on ubuntu-latest, so this isn't caught there.
The production code is probably fine, because the real sandbox is Linux. This is a test-portability problem, but it means pytest tests/unittests is red for anyone developing ADK on a Mac.
Steps to Reproduce:
- On macOS,
pip install -e '.[test]'onmain(571670d). pytest tests/unittests/integrations/vmaas/test_agent_engine_environment.py
Expected Behavior:
The tests pass, or skip, on macOS.
Observed Behavior:
13 failed, for example:
FAILED tests/unittests/integrations/vmaas/test_agent_engine_environment.py::test_written_file_is_read_back
E OSError: Failed to read .../test_written_file_is_read_back0/new dir/data.bin: stat: illegal option -- c
E usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...]
Across the 13 failures the errors are stat: illegal option -- c (6) and base64: invalid argument <file> (7). The other GNU-only options in the same command strings are dd iflag=fullblock, mv -T and chmod --reference. Failing tests: test_written_file_is_read_back, test_empty_file_is_read, test_file_of_one_slice_is_read_in_one_command, test_large_binary_file_is_read_in_slices, test_symlink_to_large_file_is_read_in_slices, test_large_file_truncated_during_read_raises, test_write_is_split_at_chunk_boundaries[one_chunk_plus_one / exactly_two_chunks / two_chunks_plus_one], test_large_binary_file_round_trips, test_chunked_write_replaces_existing_file, test_chunked_write_keeps_existing_file_mode, test_chunked_write_with_long_multibyte_filename.
Environment Details:
- ADK Library Version: 2.13.0 (editable install of
main@ 571670d) - Desktop OS: macOS 26.6.2 (arm64),
/bin/bash3.2.57 - Python Version: 3.13.15
Model Information:
- Are you using LiteLLM: N/A (unit tests only)
- Which model is being used: N/A
🟡 Optional Information
Regression:
Yes. Before 5843c58 the only such command was printf %s ... | base64 -d > file, which works with macOS base64 because it reads stdin. The failing forms arrived with the large-file read/write support on 2026-10-27. On macOS, base64 -d <file> exits 64 with invalid argument, and stat -c %s <file> exits 1 with illegal option -- c.
Possible fixes (happy to send a PR for whichever you prefer):
- Skip these tests when the local tools aren't GNU coreutils, e.g. a module-level
pytest.mark.skipifthat runsstat -c %sonce and checks it succeeds. Smallest change. - Have the fake sandbox resolve GNU tools when they're installed (
gstat,gbase64,gdd,gmv,gchmodfrom Homebrewcoreutils) by prepending a shim directory toPATH, and skip only when they're missing. This keeps the tests running on Macs that have coreutils.
AI-assisted: yes (Cana)
Activity
Samecho commentedon Oct 28, 2026
I'd like to keep this to test-side portability: use GNU tools when they're available and skip only the tests that require them when they aren't. The lifecycle tests and Linux coverage would stay active, and the production sandbox commands would be unchanged. Is anyone already working on this?
iamthehimansh commentedon Oct 28, 2026
@Samecho thanks, that's option 2 from the issue, and I'm already on it. I'll have a PR up shortly.
The plan is test-only, in one place:
_FakeSandboxes.execute_bashintest_agent_engine_environment.py, since every sandbox command goes through it. If GNU coreutils are installed (Homebrew'sgstat/gbase64/gdd/gmv/gchmod), it runsbashwith a shim directory first onPATHso the commands resolve to the GNU tools. If they aren't, only the tests that need them are skipped. Linux CI and the production sandbox commands are unchanged.AI-assisted: yes (Cana)
sanketpatil06 commentedon Oct 28, 2026
Thanks @iamthehimansh for the report and the fix!
We reproduced this on macOS: the same 13 tests fail on
main. With #7790 applied, those tests are skipped when GNU coreutils aren't installed. The PR is under review, and our team will follow up there.test: run the Agent Engine environment tests with GNU coreutils off L…