• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / fileutils
71%
master: 72%

Build:
Build:
LAST BUILD BRANCH: fix/example-watch-and-api-coverage
DEFAULT BRANCH: master
Repo Added 31 Jul 2020 07:53AM UTC
Files 2
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH fix/watcher-test-sync
branch: fix/watcher-test-sync
CHANGE BRANCH
x
Reset
  • fix/watcher-test-sync
  • chore/ci-lift
  • chore/update-deps
  • fix-ci-caching
  • fix/copyfile-self-copy-and-mode
  • fix/example-watch-and-api-coverage
  • fix/exists-stat-error-and-test-determinism
  • improvements
  • master
  • paskal/shadow
  • rbac
  • refs/tags/v0.1.0
  • refs/tags/v0.2.0
  • refs/tags/v0.3.0
  • refs/tags/v0.4.1
  • refs/tags/v0.4.2
  • review-sweep/fileutils-operability-fix-v1

19 Aug 2026 12:56AM UTC coverage: 71.338%. Remained the same
32203355139

Pull #7

github

paskal
replace sleeps in watcher tests with event synchronisation

The four watcher tests guarded themselves with os.Getenv("GOOS") == "darwin",
which never matched: GOOS is a build variable, not something the go tool exports
into the test environment. The tests therefore ran everywhere, on fixed sleeps
that were tuned for the skip that never happened.

Waiting is now driven by the events themselves. A shared waitForEvent helper
consumes the channel until the expected path shows up, returning what it skipped
so a test can assert on what should not have been reported, and gives up on a
single deadline instead of a chain of sleeps.

The 100ms and 200ms "let the watcher initialize" sleeps are gone, the watched
path is registered with the kernel before NewFileWatcher and WatchRecursive
return, so events raised afterwards are queued regardless of when the consuming
goroutine is scheduled. TestWatchRecursive no longer needs its warmup file and
timed drain loop, since waitForEvent skips past unrelated events on its own.

The event buffer goes from 10 to 100, so an expected event cannot be dropped by
the callback's non-blocking send while the test is busy.

Package tests drop from about 2.6s to 1.3s.
Pull Request #7: replace sleeps in watcher tests with event synchronisation

224 of 314 relevant lines covered (71.34%)

3.65 hits per line

Relevant lines Covered
Build:
Build:
314 RELEVANT LINES 224 COVERED LINES
3.65 HITS PER LINE
Source Files on fix/watcher-test-sync
  • Tree
  • List 2
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
32203355139 fix/watcher-test-sync replace sleeps in watcher tests with event synchronisation The four watcher tests guarded themselves with os.Getenv("GOOS") == "darwin", which never matched: GOOS is a build variable, not something the go tool exports into the test environment. T... Pull #7 19 Aug 2026 01:00AM UTC paskal github
71.34
See All Builds (41)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc