---
title: "Ebitengine: synctest, race detector and gamepads in Go"
description: "Three changes to the Ebitengine game engine in Go: audio tests on synctest's fake clock, the race detector in CI, and games starting on Linux without inotify."
url: "https://vulcode.com/en/opensource/contributions/ebiten"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

hajimehoshi/ebiten

# Ebitengine

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

[See the repository](https://github.com/hajimehoshi/ebiten) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: Go
- **GitHub stars**: 13,647
- **Merged changes**: 3
- **Project site**: [ebitengine.org](https://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](https://github.com/hajimehoshi/ebiten/pull/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](https://github.com/hajimehoshi/ebiten/pull/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](https://github.com/hajimehoshi/ebiten/pull/3849)

## Merged changes 3

- [#3849 audio: run the tests waiting on real time on synctest's fake clock Merged 6 October 2026](https://github.com/hajimehoshi/ebiten/pull/3849)

- [#3848 .github/workflows: run go test -race for all packages Merged 3 October 2026](https://github.com/hajimehoshi/ebiten/pull/3848)

- [#3705 internal/gamepad: don't fail when inotify is unavailable on Linux Merged 13 September 2026](https://github.com/hajimehoshi/ebiten/pull/3705)

## 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](https://vulcode.com/en/technologies/go)

## Other projects we write code for

- [**urfave/cli** Go · 24,329 stars A declarative Go package for building command line tools.](https://vulcode.com/en/opensource/contributions/urfave-cli)

- [**chezmoi** Go · 22,342 stars A dotfiles manager that keeps the same settings on many different machines, securely.](https://vulcode.com/en/opensource/contributions/chezmoi)

- [**goquery** Go · 14,995 stars A Go library for traversing and changing HTML documents in the style of jQuery, built on the golang.org/x/net/html parser.](https://vulcode.com/en/opensource/contributions/goquery)

- [**Fission** Go · 8,950 stars A serverless functions framework for Kubernetes that runs code as functions and scales them down to zero when they are idle.](https://vulcode.com/en/opensource/contributions/fission)

- [**Concourse** Go · 7,944 stars A container-based automation system written in Go and used mostly for CI/CD. Pipelines and tasks are described in YAML files.](https://vulcode.com/en/opensource/contributions/concourse)

- [**dromara/carbon** Go · 5,225 stars A Go package for dates and times with a simple, readable API, with helpers such as the start and end of a minute, a day or a century.](https://vulcode.com/en/opensource/contributions/dromara-carbon)

## Describe your project.

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

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
