From b4c9e5f4199c992d0e3e590fdbf090e9c4b3ac57 Mon Sep 17 00:00:00 2001 From: Googler Date: Thu, 8 Feb 2024 23:41:27 -0800 Subject: [PATCH] [7.1.0] Manipulate the local filesystem directly in the writeLocalFile test helper. To ensure that we're actually modifying the local filesystem, even if the RemoteActionFileSystem#getOutputStream implementation changes in the future. PiperOrigin-RevId: 605539937 Change-Id: I1e17642153e2faec357a0778b9673c1f3fff0ea8 --- .../build/lib/remote/RemoteActionFileSystemTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/google/devtools/build/lib/remote/RemoteActionFileSystemTest.java b/src/test/java/com/google/devtools/build/lib/remote/RemoteActionFileSystemTest.java index ca6ffae8eeaaf4..711cda52ad4b11 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/RemoteActionFileSystemTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/RemoteActionFileSystemTest.java @@ -1139,8 +1139,9 @@ protected FileArtifactValue injectRemoteFile( @Override protected void writeLocalFile(FileSystem actionFs, PathFragment path, String content) throws IOException { - actionFs.getPath(path).getParentDirectory().createDirectoryAndParents(); - FileSystemUtils.writeContent(actionFs.getPath(path), UTF_8, content); + FileSystem localFs = getLocalFileSystem(actionFs); + localFs.getPath(path).getParentDirectory().createDirectoryAndParents(); + FileSystemUtils.writeContent(localFs.getPath(path), UTF_8, content); } /** Returns a remote artifact and puts its metadata into the action input map. */