From 81255a9ac1f278f5cda17b4efe47386e9e144d78 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 02:47:23 +0000 Subject: [PATCH] Improve test robustness with path validation and named constant Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com> --- src/Test/L0/Listener/RunnerL0.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Test/L0/Listener/RunnerL0.cs b/src/Test/L0/Listener/RunnerL0.cs index ed90b7d1f..a8f432a06 100644 --- a/src/Test/L0/Listener/RunnerL0.cs +++ b/src/Test/L0/Listener/RunnerL0.cs @@ -1107,8 +1107,12 @@ namespace GitHub.Runner.Common.Tests.Listener // Place a file where the work directory should be - this blocks Directory.CreateDirectory string parentPath = Path.GetDirectoryName(workPath); + Assert.NotNull(parentPath); + Assert.NotEmpty(parentPath); Directory.CreateDirectory(parentPath); - File.WriteAllText(workPath, "blocking file content"); + + const string blockingFileContent = "test file blocking directory creation"; + File.WriteAllText(workPath, blockingFileContent); const int testPoolId = 12345; const int testAgentId = 67890;