test: increase FlakeAttempts for library directory tests and remove flaky job test

This commit is contained in:
Deluan 2026-03-23 11:59:11 -04:00
parent d91b5e8f4d
commit 4cca7bce4e
2 changed files with 2 additions and 30 deletions

View file

@ -2,7 +2,6 @@ package scheduler
import (
"testing"
"time"
"github.com/navidrome/navidrome/log"
. "github.com/onsi/ginkgo/v2"
@ -48,31 +47,4 @@ var _ = Describe("Scheduler", func() {
Expect(id).ToNot(BeZero())
s.Remove(id)
})
It("removes a job", func() {
done := make(chan struct{})
counter := 0
id, err := s.Add("@every 50ms", func() {
counter++
if counter == 1 {
close(done)
}
})
Expect(err).ToNot(HaveOccurred())
Expect(id).ToNot(BeZero())
// Verify job executed
Eventually(done).Should(BeClosed())
Expect(counter).To(Equal(1))
// Remove the job
s.Remove(id)
// Wait some time to ensure job doesn't execute again
time.Sleep(200 * time.Millisecond)
// Verify counter didn't increase
Expect(counter).To(Equal(1))
})
})