Skip to content

Commit e391d6a

Browse files
committed
Ensure lingering content from test harness approach does not remain after mvn clean
1 parent 7206e84 commit e391d6a

1 file changed

Lines changed: 18 additions & 22 deletions

File tree

java/pom.xml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,37 +167,33 @@
167167
<groupId>org.apache.maven.plugins</groupId>
168168
<artifactId>maven-clean-plugin</artifactId>
169169
<version>3.4.1</version>
170-
<configuration>
171-
<!--
172-
The E2E test harness spawns Node.js child processes
173-
(npx tsx server.ts) whose CWD is inside
174-
target/copilot-sdk/test/harness/. On macOS, orphaned
175-
node processes can briefly hold file descriptors on
176-
the directory tree after the test JVM exits, causing
177-
the first 'mvn clean' to fail with
178-
"Failed to delete target/copilot-sdk".
179-
180-
retryOnError + retryCount give the OS time to reap
181-
those processes before the clean phase gives up.
182-
-->
183-
<retryOnError>true</retryOnError>
184-
</configuration>
185170
<executions>
186171
<execution>
187172
<!--
188-
The VS Code Roslyn language server monitors .csproj
189-
files in the cloned repo at target/copilot-sdk/dotnet/
190-
and immediately re-creates obj/ metadata after the
191-
default-clean execution deletes target/. By running a
192-
second clean in post-clean, the resurrected directories
193-
are swept away and Roslyn does not recreate them again
194-
(the .csproj is already gone).
173+
The default-clean execution uses failOnError=false
174+
because external processes (VS Code language servers,
175+
orphaned Node.js test-harness processes) can hold
176+
file descriptors on target/copilot-sdk/ just long
177+
enough to prevent deletion. The post-clean-sweep
178+
retries immediately afterward (by which time the
179+
transient locks have cleared) to ensure target/ is
180+
fully removed.
195181
-->
182+
<id>default-clean</id>
183+
<configuration>
184+
<retryOnError>true</retryOnError>
185+
<failOnError>false</failOnError>
186+
</configuration>
187+
</execution>
188+
<execution>
196189
<id>post-clean-sweep</id>
197190
<phase>post-clean</phase>
198191
<goals>
199192
<goal>clean</goal>
200193
</goals>
194+
<configuration>
195+
<retryOnError>true</retryOnError>
196+
</configuration>
201197
</execution>
202198
</executions>
203199
</plugin>

0 commit comments

Comments
 (0)