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

valkyrjaio / valkyrja-java / 30328670610
100%

Build:
DEFAULT BRANCH: 26.x
Ran 28 Jul 2026 04:25AM UTC
Jobs 1
Files 659
Run time 2min
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

28 Jul 2026 04:24AM UTC coverage: 99.977%. Remained the same
30328670610

push

github

web-flow
[Log] Resolve the log provider publishers through the container to fix a flaky test (#59)

# Description

Fixes a flaky test that fails roughly half of all runs, on `26.x` and on
every
open PR branch.


`LogServiceProviderTest::everyPublisherBindsItsServiceThroughTheContainer`
drove
the publishers by iterating the provider's own map:

```java
provider.publishers().forEach((id, publisher) -> publisher.accept(container));
```

`publishers()` returns a `Map.of(...)`, and **the JVM deliberately
randomizes
`Map.of` iteration order on every run** (an immutability-contract
safeguard, so
callers cannot depend on an order that was never specified).
`publishLogger`
reads the `FileLogger` singleton that `publishFileLogger` binds:

```java
container.setSingleton(LoggerContract.class, container.getSingleton(FileLogger.class));
```

So whenever the randomized order happened to reach `LoggerContract`
before
`FileLogger`, the publisher ran against a container that had no
`FileLogger` yet
and threw `ContainerInvalidReferenceException: Service with
io.valkyrja.log.logger.FileLogger not found`.

**This is a test defect, not a production one.**
`Container.getSingleton` calls
`publishUnpublishedDeferred(id)` before resolving, so once the provider
is
registered, requesting `LoggerContract` publishes `FileLogger` on demand
—
whatever order the publishers are stored in. The test was the only
caller
invoking publishers directly on a bare container, bypassing the very
mechanism
that makes ordering irrelevant. No `src/` change is warranted, and none
is made
here: hardening `publishLogger` against an unbound `FileLogger` would be
a branch
the container guarantees can never be taken.

The test now registers the provider and resolves through the container —
the path
production takes — and a second test pins that the deferred logger is
the *same
instance* as the file logger, which is the actual contract
`publishLogger`
implements.

Verified 6 consecutive `--rerun-tasks` runs green,... (continued)

1904 of 1906 branches covered (99.9%)

Branch coverage included in aggregate %.

6958 of 6958 relevant lines covered (100.0%)

4.34 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30328670610.1 28 Jul 2026 04:25AM UTC 659
99.98
GitHub Action Run
Source Files on build 30328670610
  • Tree
  • List 659
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30328670610
  • 9386f46c on github
  • Prev Build on 26.x (#30325186143)
  • Next Build on 26.x (#30328964911)
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