Skip to content

Fail the Db2 rows at once when the runner cannot fetch the Db2 image - #16929

Open
matrei wants to merge 4 commits into
8.0.xfrom
test/skip-db2-rows-when-image-unreachable
Open

matrei wants to merge 4 commits into
8.0.xfrom
test/skip-db2-rows-when-image-unreachable

Conversation

@matrei

@matrei matrei commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Since the Db2 rows of the Hibernate 7 specs landed in #16750, Hibernate7 Functional Tests and Coverage jobs have failed on them with

org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=icr.io/db2_community/db2:11.5.9.0, ...)
Caused by: org.testcontainers.shaded.org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in org.testcontainers.images.RemoteDockerImage was not fulfilled within 2 minutes.

All of them ran on runners in the Azure region westus3, which the header of the job log names. By 11-11, 8 of the 19 jobs that ran there had failed this way, and none of the 36 in other regions. From 11-12 to 11-23, 11 more jobs failed on the fetch, all in westus3. The test output in the build scan shows that the runner's Docker daemon gets no answer from IBM's registry at all. Every attempt fails within about 15 seconds with

Status 500: {"message":"Get \"https://icr.io/v2/\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"}

or with context deadline exceeded. A longer pull timeout, or pulling the image before the tests, would not get it either.

Such a job lost about 20 minutes before it failed:

  • Testcontainers retries the pull for two minutes.
  • GenericContainer.doStart() retries it in full once more while it builds its error message.
  • Each of the four specs with a Db2 row starts over.

The specs now start the container of a row through DatabaseContainers.start(). For Db2, it fetches the image once per test JVM before it starts the container. When the fetch fails, the first Db2 row fails with the failure and every later one fails with it at once. A job on such a runner then fails after one round of attempts, about 3.5 minutes, instead of about 20, and the message names the image and what went wrong:

org.testcontainers.containers.ContainerFetchException: Pulling icr.io/db2_community/db2:11.5.9.0 failed: Condition with Lambda expression in org.testcontainers.images.RemoteDockerImage was not fulfilled within 2 minutes.

A rerun of the job usually lands in another region and passes. A registry that answers, for example that the tag is not there, fails the rows the same way, within a second. A container that fails to start once its image is there still fails its row.

DatabaseContainers.start() replaces the start block that the seven specs using the shared containers each repeated. For the three specs without a Db2 row, nothing changes.

The first version of this pull request skipped the Db2 rows instead. Review showed that a skip needs a guard for each way it could hide a real failure, for example a tag that isn't there, which every runner would have skipped as well, so the rows fail now.

Verification

  • DatabaseContainersSpec covers start() for no container, a running one, a container other than Db2 and one that fails to start. For the Db2 container, it covers that the image is fetched before the container is started, that the container is not started when the fetch fails, and that after a failed start the next row starts it again without fetching again. It covers the fetch too: once when it succeeds, once when it fails, with every later row failing with the same failure, again after an error ended it, and the message for a timeout, a 404, a failure without a cause and a cause without a message.
  • With a tag that isn't there, the four Db2 rows fail within 2 s each with Pulling icr.io/db2_community/db2:0.0.0-nope failed: Status 404: … not found.
  • With a registry that can't be resolved, db2.invalid, the first Db2 row fails after 206 s with Pulling db2.invalid/db2_community/db2:11.5.9.0 failed: Condition … was not fulfilled within 2 minutes., and the other three fail with it within 2 s each.
  • All tests of grails-data-hibernate7-core pass with the real image: 4,620 tests, with the 15 skipped as before.

Merging

It merges up cleanly to 8.1.x, 9.0.x, 9.1.x and 10.0.x.

The Docker daemon of some GitHub-hosted runners, so far all in the Azure
region westus3, gets no answer from IBM's registry, icr.io, where the
Db2 image comes from: every pull fails within about 15 seconds with
Docker's 500 for "Get https://icr.io/v2/", "request canceled while
waiting for connection" or "context deadline exceeded". Since the Db2
rows landed in #16750, that has failed six Hibernate7 Functional Tests
jobs and two Coverage jobs, each after about 20 minutes: Testcontainers
retries the pull for two minutes, GenericContainer.doStart() retries it
in full once more while it builds its error message, and each of the
four specs with a Db2 row starts over.

The specs now start the container of a row through
DatabaseContainers.start(). For Db2 it fetches the image once per test
JVM before it starts the container, and when the fetch fails it throws
TestAbortedException, so the Db2 rows are reported as skipped with the
reason, as they are on arm64. The other Hibernate 7 jobs of the run
still run them. A container that fails to start once its image is there
still fails its row.
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.5751%. Comparing base (87231f2) to head (506eaa4).
⚠️ Report is 132 commits behind head on 8.0.x.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16929        +/-   ##
==================================================
+ Coverage     62.3608%   62.5751%   +0.2142%     
- Complexity      27305      27545       +240     
==================================================
  Files            2248       2249         +1     
  Lines          111469     111725       +256     
  Branches        20422      20486        +64     
==================================================
+ Hits            69513      69912       +399     
+ Misses          32622      32454       -168     
- Partials         9334       9359        +25     

see 42 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approving. One failed image fetch skips every later row in that process, even after the image can be fetched.

}

private static synchronized void fetchDb2Image() {
if (db2FetchFailure == null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first row cannot fetch the image, then the registry recovers before the next row. The next row is skipped without trying again. A row that can fetch the image should run. Try the fetch again after a failure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each failed job so far already did what this asks: every Db2 row retried for about 2.5 minutes on its own, so each job retried for about 20 minutes, and none of the 28 rows in the 7 failed jobs I checked got the image (all 16 attempts in the build scan failed too). A short registry outage is already covered by the retries inside the first fetch. A later retry would add about 7.5 minutes to each such job and has not recovered once so far. A skipped row shows in the report with its reason, and the other Hibernate 7 jobs of the run still run the Db2 rows. If we ever see a runner recover, retrying is a small change.

@matrei
matrei requested a review from jamesfredley November 14, 2026 21:53
@jdaugherty

Copy link
Copy Markdown
Contributor

Doesn't this have the potential to mask failures? Since they'll always be skipped? There's no indication on a PR when a test is skipped this way.

A Db2 row skipped because the image could not be fetched showed only in
the test report, so neither the job nor its pull request showed that the
Db2 rows had not run there.

On GitHub Actions, a test task of grails-data-hibernate7-core that
skipped Db2 rows for that reason now ends with a warning workflow
command, which adds an annotation with the number of rows and the reason
to the job.
@matrei

matrei commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

They are skipped only on a runner whose Docker daemon cannot fetch the image from icr.io. Everything after the fetch fails as before: a Db2 container that does not start, or a Db2 row whose assertions fail. On this PR's own CI, the Db2 rows ran and passed in all four jobs that run them.

Those four jobs are the three Hibernate7 Functional Tests jobs that run grails-data-hibernate7-core (one for each Java and indy combination) and Coverage - grails-core. A Db2 failure would go unnoticed only if all four landed on runners that cannot reach icr.io. Since this PR was opened, eight more jobs have failed on the fetch, on PRs into 8.0.x and 9.0.x and on pushes to 8.1.x and 9.1.x. All eight ran on westus3, and nothing else failed in any of them. In each of the seven CI runs among them, the other Hibernate 7 jobs passed, so the Db2 rows ran and passed there. Each of the eight jobs ran for 50 to 75 minutes and then had to be rerun.

You're right that the PR showed nothing when the rows were skipped. The new commit adds a warning: on GitHub Actions, a test task of grails-data-hibernate7-core that skipped Db2 rows because the image could not be fetched ends with a ::warning workflow command. The job then gets an annotation, which shows on the run's summary page and on the PR's Checks tab, for example:

Db2 rows skipped
4 Db2 rows of :grails-data-hibernate7-core:test skipped. The Db2 image could not be fetched, so the Db2 rows are skipped: Can't get Docker image: RemoteDockerImage(imageName=icr.io/db2_community/db2:11.5.9.0, …)

With the image pointed at an unreachable registry, the build passed with the 4 Db2 rows of this branch skipped and printed that warning once, also when the configuration cache entry was reused. With the real image, every row ran and there was no warning.

@codeconsole codeconsole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues need fixing before merge, plus unit test coverage for the new skip behavior:

  1. Build-cache poisoning suppresses Db2SkipWarning and skips Db2 on healthy runners: gradle/hibernate7-test-config.gradle and gradle/grails-data-tck-config.gradle keep outputs.cacheIf { cacheTests } enabled even in CI (unlike gradle/test-config.gradle's !ciBuild && cacheTests), and org.gradle.caching=true is enabled repo-wide. Previously a failed Db2 fetch failed the task and was never cached; now the task passes with Db2 skipped and its output can be stored in the local/remote Develocity build cache. Any later run without --rerun-tasks (such as Coverage - grails-core, which runs jacocoAggregateReport without --rerun-tasks, or a local rerun) can restore :grails-data-hibernate7-core:test FROM-CACHE without running Db2 and without firing Db2SkipWarning.
  2. Local failures are silently masked: fetchDb2Image() skips on any ContainerFetchException even outside GitHub Actions, where Db2SkipWarning is not attached. Gate the skip fallback on GITHUB_ACTIONS == 'true' so local runs fail loudly.
  3. Missing automated tests: Neither DatabaseContainers.start() nor the REASON prefix contract / Db2SkipWarning is covered by automated tests, and Db2SkipWarning never runs on healthy CI runners.

}

if (providers.environmentVariable('GITHUB_ACTIONS').orNull == 'true') {
tasks.withType(Test).configureEach { Test task ->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because hibernate7-test-config.gradle and grails-data-tck-config.gradle set outputs.cacheIf { cacheTests } (which stays true in CI, unlike test-config.gradle's !ciBuild && cacheTests), a :grails-data-hibernate7-core:test run that passes with the 4 Db2 rows skipped can be stored in the local or remote Develocity build cache (--rerun-tasks in hibernate7Functional skips cache lookup, not cache store). A subsequent run without --rerun-tasks — such as Coverage - grails-core (.github/workflows/coverage.yml) — then restores the task FROM-CACHE, keeping Db2 skipped on a healthy runner and never invoking Db2SkipWarning.

Disable build caching for this module's Test tasks (e.g. task.outputs.cacheIf('Db2 rows may be skipped when icr.io is unreachable') { false }, and/or disable test caching in CI in hibernate7-test-config.gradle and grails-data-tck-config.gradle to match test-config.gradle).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer applies since f061141: the Db2 rows fail instead of being skipped, so a failed fetch fails the task again, and nothing is stored. For the record, Coverage does load this task from the cache (:grails-data-hibernate7-core:test FROM-CACHE in both of the last two Coverage runs on 8.0.x, 45115506146 and 45080688129). But the Hibernate 7 shard jobs, which run the Db2 rows, use testShard --rerun-tasks and load no test results, so a cached skip couldn't have made a healthy runner skip them there.

try {
// Pulls the image unless Docker has it; the container keeps the name, so start() does not pull again
DB2.dockerImageName
} catch (ContainerFetchException e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetchDb2Image() catches ContainerFetchException unconditionally, even outside GitHub Actions where Db2SkipWarning is not attached. On a local machine, a typoed/retired Db2 image tag or registry/daemon error will silently skip all 4 Db2 rows and finish with BUILD SUCCESSFUL (and UP-TO-DATE on the next run).

Gate the skip-on-fetch-failure fallback on System.getenv('GITHUB_ACTIONS') == 'true' (matching grails-data-hibernate7/core/build.gradle) so local runs fail loudly, and add a unit spec covering DatabaseContainers.start() (null/running no-ops, non-Db2 passthrough, Db2 fetch-once abort caching, and post-fetch start() failures still failing).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and it went further than local runs. A registry that answers fails the pull within a second with a NotFoundException (Status 404: … not found, for a missing tag and for a missing repository alike). Every runner gets that answer, so a typo or a retired tag would have skipped the Db2 rows in every job, and only the warnings would have shown it. Since f061141 nothing is skipped: the first Db2 row fails with the fetch failure, and every later one fails with it at once.

DatabaseContainersSpec covers start() for no container, a running one, a container other than Db2, which is started without a fetch, and one that fails to start. It also covers the fetch: once when it succeeds, once when it fails, with every later row failing with the same failure, and the message for a timeout, a 404 and a failure without a cause.

With the four specs that have Db2 rows:

  • With a tag that isn't there, the four Db2 rows fail within 2 s each with Pulling icr.io/db2_community/db2:0.0.0-nope failed: Status 404: … not found.
  • With a registry that can't be resolved, db2.invalid, the first Db2 row fails after 206 s with Pulling db2.invalid/db2_community/db2:11.5.9.0 failed: Condition with Lambda expression in org.testcontainers.images.RemoteDockerImage was not fulfilled within 2 minutes., and the other three fail with it within 2 s each.

With the real image, all tests of grails-data-hibernate7-core pass: 4,615 tests, with the 15 skipped as before.

// On GitHub Actions, the build script of this module looks for the start of this message to warn about the
// skipped rows
throw new TestAbortedException(
"The Db2 image could not be fetched, so the Db2 rows are skipped: ${db2FetchFailure.message}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional clarity improvement: db2FetchFailure.message is only Testcontainers' wrapper (Can't get Docker image: RemoteDockerImage(...)). Including db2FetchFailure.cause?.message when present would make the GitHub Actions warning annotation show the failure reason directly without opening the build scan.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f061141. The message names the image and the cause, for example Pulling icr.io/db2_community/db2:11.5.9.0 failed: Condition with Lambda expression in org.testcontainers.images.RemoteDockerImage was not fulfilled within 2 minutes. On westus3 the cause is that timeout: the Docker daemon's 500 for each attempt is only in Testcontainers' log of its retries, which the build scan keeps.

@borinquenkid

Copy link
Copy Markdown
Member

@matrei a heads-up on sequencing, nothing to change here. #16954, #16955 and #16962 also edit DatabaseContainers.groovy: they add cannotRun(), which skips a row when no Docker daemon answers or when the image is amd64-only on an arm64 machine, and the specs call start() on the container themselves. They merge with a conflict in that file, as I checked against this head (506eaa443b).

The two do different jobs. This PR skips the Db2 rows when the registry cannot be reached; mine skip rows when the machine cannot run them. Yours was opened first, so I will not touch DatabaseContainers on my three until this merges, and then I merge 8.0.x into them and resolve the conflict myself, so that the rows start through your start().

…not be fetched

A skip needed a guard for every way it could hide a real failure. A tag
that is not there fails the pull with a 404 on every runner, so it
skipped the rows everywhere. A local run skipped them without a word.
The warning on GitHub Actions depended on the start of the skip
message. And a test result with the rows skipped could be stored in
the build cache.

The rows now fail again. The image is still fetched once per test JVM,
and once that has failed, every later Db2 row fails with that failure
at once. A job on a runner that cannot reach icr.io now fails after one
round of attempts instead of after about 20 minutes. The message names
the image and the cause of the failure.

The warning listener and the opentest4j dependency are no longer
needed, so the build script is as on 8.0.x.
@matrei matrei changed the title Skip the Db2 rows when the runner cannot fetch the Db2 image Fail the Db2 rows at once when the runner cannot fetch the Db2 image Nov 23, 2026
@matrei

matrei commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@codeconsole thanks for the review. It made me drop the skip. Making a skip safe needed a guard for each way it could hide a real failure: a tag that isn't there skipped the rows on every runner, a local run skipped them without a word, the warning depended on a message prefix, and a cached result could carry the skip. That's more than a workaround for one region's network is worth.

Since f061141, the Db2 rows fail again, but after one round of attempts, about 3.5 minutes, instead of about 20, and with a message that says what went wrong. A rerun of the job usually lands in another region and passes. The warning listener and the opentest4j dependency are gone, so build.gradle is as on 8.0.x. The inline replies have the details.

@jdaugherty that also answers your question whether the skip could hide failures: nothing is skipped now. @jamesfredley one failed fetch still fails the later Db2 rows of the test JVM at once. In the 7 failed jobs whose logs I checked in November, all four Db2 rows failed, each after its own round of attempts, so a later fetch wouldn't have got through either. Since 11-12, 11 more jobs have failed on the fetch, all of them in westus3.

I've updated the title and the description.

@codeconsole codeconsole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues should be fixed before merging:

  1. DatabaseContainersSpec never exercises the if (container.is(DB2)) wiring in DatabaseContainers.start()—deleting lines 88–90 or calling container.start() before fetch() still leaves all tests green.
  2. ImageFetch.fetch() sets attempted = true before calling container.dockerImageName, so an uncaught Error (which GenericContainer.getDockerImageName() does not wrap in ContainerFetchException) leaves attempted == true with failure == null and makes later calls treat the fetch as succeeded.

See inline comments for details and two minor clarity suggestions.

if (container == null || container.running) {
return
}
if (container.is(DB2)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DatabaseContainersSpec never exercises this branch: it calls DatabaseContainers.start() only with null and non-Db2 mocks, and tests ImageFetch.fetch() in isolation. Deleting lines 88–90 or moving them after container.start() leaves every test passing.

Delegate start(GenericContainer) to a package-private helper (e.g., start(GenericContainer container, GenericContainer db2, ImageFetch db2ImageFetch)) and add tests in DatabaseContainersSpec proving that for Db2 fetch() runs before container.start(), container.start() is skipped when fetch() fails, and a subsequent start() after a ContainerLaunchException does not re-fetch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the spec only reached ImageFetch directly. start(GenericContainer) now hands the Db2 container and the fetch of its image to a package-scope start(container, db2, db2ImageFetch), and three new features go through it with a mock Db2 container:

  • its image is fetched before it is started,
  • it is not started when the fetch fails, by that row or the next,
  • after a ContainerLaunchException, the next row starts it again without fetching again.

The feature for a container other than Db2 now also checks that the Db2 fetch is not touched. With the Db2 branch deleted, or moved after container.start(), all three new features fail.

*/
synchronized void fetch() {
if (!attempted) {
attempted = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting attempted = true before container.dockerImageName runs leaves ImageFetch claiming success (attempted == true, failure == null) if a non-ContainerFetchException throwable (such as an Error, which GenericContainer.getDockerImageName() does not catch) escapes. Move attempted = true after the try/catch block so it is only set once the fetch either succeeds or records a ContainerFetchException.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved: attempted is set after the try/catch, so an error that ends the fetch leaves it unset and the next row fetches the image again. A new feature throws a NoClassDefFoundError from the first fetch and checks that the second one fetches; it fails with attempted set first.

The later rows wouldn't have passed as fetched without the move, though. container.start() resolves the image again, because Testcontainers' LazyFuture keeps no value from a resolve that threw, so each of them would have pulled once more, as before this PR.

attempted = true
try {
// Pulls the image unless Docker has it; the container keeps the name, so start() does not pull again
container.dockerImageName

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Optional) container.getDockerImageName() reads more clearly than bare property access container.dockerImageName when the call is made solely for its side effect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep the property: the Groovy in this module reads getters as properties, and the comment above the line says it's read for the pull.

import org.testcontainers.containers.ContainerFetchException
import org.testcontainers.containers.ContainerLaunchException
import org.testcontainers.containers.GenericContainer
import org.testcontainers.shaded.org.awaitility.core.ConditionTimeoutException

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Optional) ImageFetch.fetch() only reads failure.cause?.message ?: failure.message and does not branch on the cause type. Importing Testcontainers' internal shaded ConditionTimeoutException (and transitive docker-java NotFoundException) couples this test to Testcontainers' shading layout while timeout() and notFound() exercise the same branch. Using plain new RuntimeException('...') avoids those imports, and adding a new RuntimeException() case (non-null cause with null message) covers the ?: fallback branch too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the row for a cause without a message. I'd keep the two exception types, though. They are what Testcontainers and the Docker daemon throw for the two failures we've seen, a registry that doesn't answer and a tag that isn't there, and the 404 row shows the Status 404: that docker-java puts before the message, as the Db2 rows show it. If Testcontainers stops shading Awaitility, the spec stops compiling, so it can't go stale unnoticed.

DatabaseContainersSpec called start() only with containers other than
Db2, so it still passed with the Db2 fetch removed from start() or moved
after container.start(). start() now hands the Db2 container and the
fetch of its image to a package-scope overload, which the spec calls
with a mock Db2 container.

ImageFetch marked the fetch as tried before it ran, so an error that
ended it, which getDockerImageName() does not wrap, left the image
looking fetched. It is now marked once the fetch has succeeded or failed
with a ContainerFetchException.
@testlens-app

testlens-app Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: e94f572
▶️ Tests: 22279 executed
⚪️ Checks: 97/97 completed


Learn more about TestLens at testlens.app/docs.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes. A missing database image still fails the suite.

}
if (failure != null) {
// The message of the exception only names the image; its cause says what went wrong
throw new ContainerFetchException(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A row that needs a database image runs when that image cannot be fetched. The suite fails, because the failed fetch is thrown instead of skipping that row. Skip the row.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's on purpose: a missing image has to fail the suite. The first version of this PR skipped the row, and codeconsole's review showed what that hides. A tag that isn't there gets a 404 on every runner, so a typo or a retired tag would have skipped the Db2 rows in every job, and a local run would have skipped them without a word. Since f061141 the rows fail instead, but after one round of attempts, about 3.5 minutes instead of about 20, and with a message that names the image and the cause. On a westus3 runner, a rerun of the job usually lands in another region and passes.

@codeconsole codeconsole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found; two optional visibility tweaks noted inline.

static final OracleContainer ORACLE = new OracleContainer('gvenzl/oracle-free:slim-faststart')
.withStartupTimeout(Duration.ofMinutes(3))

static final String DB2_IMAGE = 'icr.io/db2_community/db2:11.5.9.0'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Optional) DB2_IMAGE is only used inside DatabaseContainers, so this can be private static final.

* once instead of fetching it again.
*/
@CompileStatic
static final class ImageFetch {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Optional) ImageFetch is only referenced within grails.gorm.tests; marking it @PackageScope matches the package-private start overload.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants