bd sync: 2025-12-27 15:56:42

This commit is contained in:
Steve Yegge
2025-12-27 15:56:42 -08:00
parent 87f535a65e
commit c8b912cbe6
179 changed files with 3051 additions and 10283 deletions

View File

@@ -336,8 +336,8 @@ func TestRun_Async(t *testing.T) {
outputFile := filepath.Join(tmpDir, "async_output.txt")
// Create a hook that writes to a file
hookScript := "#!/bin/sh\n" +
"echo \"async\" > \"" + outputFile + "\"\n"
hookScript := `#!/bin/sh
echo "async" > ` + outputFile
if err := os.WriteFile(hookPath, []byte(hookScript), 0755); err != nil {
t.Fatalf("Failed to create hook file: %v", err)
}
@@ -348,17 +348,15 @@ func TestRun_Async(t *testing.T) {
// Run should return immediately
runner.Run(EventClose, issue)
// Wait for the async hook to complete with retries.
// Under high test load the goroutine scheduling + exec can be delayed.
// Wait for the async hook to complete with retries
var output []byte
var err error
deadline := time.Now().Add(3 * time.Second)
for time.Now().Before(deadline) {
for i := 0; i < 10; i++ {
time.Sleep(100 * time.Millisecond)
output, err = os.ReadFile(outputFile)
if err == nil {
break
}
time.Sleep(50 * time.Millisecond)
}
if err != nil {