This is an automated email from the ASF dual-hosted git repository.
Gabriel39 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new aba3c6ac2ae [test](orc) Fix fixture extraction in restricted
containers (#71323)
aba3c6ac2ae is described below
commit aba3c6ac2ae7b32a29b85e95b94204eec93ad22b
Author: Gabriel <[email protected]>
AuthorDate: Thu Dec 3 14:14:57 2026 +0800
[test](orc) Fix fixture extraction in restricted containers (#71323)
### Background
Two `NewOrcReaderTest` cases read projected nested structs from a
checked-in Hive ORC archive, with eager and lazy loading respectively.
Each case extracts that archive before checking the reader's results.
### What problem does this PR solve?
Issue Number: None
Related PR: None
PR Type: Test
Problem Summary:
Both cases fail during fixture preparation when run as root in
containers without `CAP_CHOWN`: tar tries to restore archived ownership
and exits with status 2 (`std::system` status 512). Add
`--no-same-owner` to both extraction commands so fixture preparation
succeeds without changing the ORC data or reading assertions.
### Details
- **Failure:** `ReadProjectedNestedStructChildFromHiveOrcFixture` and
`ReadLazyProjectedNestedStructChildFromHiveOrcFixture` stop at the
extraction assertion with `Cannot change ownership`. The original
commands both fail deterministically in a fresh container with
`--cap-drop ALL` and `no-new-privileges`.
- **Cause:** Root tar restores the archive's ownership by default, but
the isolated container lacks the capability to change file ownership.
The tests only need the file contents.
- **Stability evidence:** Executed each extraction command taken from
the test source before and after the change. Both fail before the change
in restricted root containers. After the change, both succeed as
restricted root, ordinary root, and restricted non-root, with all nine
extracted file hashes matching the archive.
### Testing
- Locally executed the two source-derived extraction commands in fresh
`ubuntu:latest` containers with `--cap-drop ALL --security-opt
no-new-privileges`: both fail before the fix and succeed after it.
- Also verified both fixed commands as ordinary root and restricted
non-root; compared every extracted file's SHA-256 with the checked-in
archive.
- Full BE unit tests were not run locally; this worktree has no built
`doris_be_test` binary.
### Release note
None
### Check List (For Author)
- Behavior changed: No
- Does this need documentation: No
- Pre-submission status: Partially verified: fixture extraction
verified; full BE unit tests not run locally.
### AI Disclosure
- Tool: Codex (GPT-6)
- Generated: Test fixture command changes and this description.
- Human review: not stated
---
be/test/format_v2/orc/orc_reader_test.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/be/test/format_v2/orc/orc_reader_test.cpp
b/be/test/format_v2/orc/orc_reader_test.cpp
index 22a6ebfdbdd..4e8c7726f08 100644
--- a/be/test/format_v2/orc/orc_reader_test.cpp
+++ b/be/test/format_v2/orc/orc_reader_test.cpp
@@ -13136,8 +13136,9 @@ TEST_F(NewOrcReaderTest,
ReadProjectedNestedStructChildFromHiveOrcFixture) {
ASSERT_TRUE(std::filesystem::exists(archive)) << archive;
const auto extract_dir = _test_dir / "orc_nested_types";
std::filesystem::create_directories(extract_dir);
+ // Restoring archived ownership requires CAP_CHOWN, which isolated test
containers lack.
const std::string extract_cmd =
- "tar -xzf '" + archive.string() + "' -C '" + extract_dir.string()
+ "'";
+ "tar --no-same-owner -xzf '" + archive.string() + "' -C '" +
extract_dir.string() + "'";
ASSERT_EQ(std::system(extract_cmd.c_str()), 0);
const auto file_path =
extract_dir /
@@ -13199,8 +13200,9 @@ TEST_F(NewOrcReaderTest,
ReadLazyProjectedNestedStructChildFromHiveOrcFixture) {
ASSERT_TRUE(std::filesystem::exists(archive)) << archive;
const auto extract_dir = _test_dir / "lazy_orc_nested_types";
std::filesystem::create_directories(extract_dir);
+ // Restoring archived ownership requires CAP_CHOWN, which isolated test
containers lack.
const std::string extract_cmd =
- "tar -xzf '" + archive.string() + "' -C '" + extract_dir.string()
+ "'";
+ "tar --no-same-owner -xzf '" + archive.string() + "' -C '" +
extract_dir.string() + "'";
ASSERT_EQ(std::system(extract_cmd.c_str()), 0);
const auto file_path =
extract_dir /
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]