All contributions

hajimehoshi/ebiten

Ebitengine

A 2D game engine in Go, used in games released for computers, phones, browsers and consoles.

Language
Go
GitHub stars
13,647
Merged changes
3
Project site
ebitengine.org

What we changed

Audio tests that waited on real time now run on synctest's fake clock, CI runs the race detector for every package, and a game on Linux starts even when inotify is unavailable.

What this work shows

  • testing/synctest and fake clocks in Go
  • Go race detector in GitHub Actions
  • Goroutine lifecycle and sync.Cond
  • inotify and Linux kernel limits
What was broken

The game failed to start over an inotify limit

inotify limits are per user, so another program could use them up, and RunGame then failed at startup with gamepad: InotifyAddWatch failed: no space left on device. Yet inotify is only used to detect gamepads plugged in while the game runs.

How we fixed it

Without inotify the game starts and gamepads work

When inotify is unavailable, init keeps the gamepads from the initial scan and only skips hotplug detection, as GLFW does. The descriptor is closed if adding the directory watch fails.

#3705

What was broken

CI never ran the race detector

No workflow step ran go test with -race, so the concurrency tests in the root package, text/v2, vector and the internal and exp packages could not catch a data race.

How we fixed it

go test -race for every package

A new step runs go test -race -shuffle=on -p=1 ./... on Linux with the newest Go. Its first run caught a checkptr error in the IME tests of internal/glfw, which was fixed before the merge.

#3848

What was broken

Audio tests waited on real time

Tests in the audio package, such as TestGC and TestSameSourcePlayers, polled the state with 200 ms time.Sleep calls, and one carried a TODO asking whether virtual time could be used.

How we fixed it

Tests on synctest's fake clock

The tests run inside synctest.Test, so waiting passes on a fake clock. ResetContextForTesting now stops the goroutine updating the players and the dummy players, so nothing is left in the synctest bubble after a test.

#3849

Merged changes 3

  1. #3849 audio: run the tests waiting on real time on synctest's fake clock Merged 6 October 2026
  2. #3848 .github/workflows: run go test -race for all packages Merged 3 October 2026
  3. #3705 internal/gamepad: don't fail when inotify is unavailable on Linux Merged 13 September 2026

What it taught us

Tests of concurrent code only become trustworthy with synctest's fake clock instead of sleeping and with the race detector in CI for the whole repository. In production code we tell a fatal error apart from a missing optional feature, such as gamepad hotplug detection.

More about this technology: Golang

Other projects we write code for

Describe your project.

A free quote comes back within an hour during working hours.