Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add a workaround for testcontainers/testcontainers-java#6441 #152

Merged
merged 3 commits into from
Oct 20, 2023

Conversation

monosoul
Copy link
Owner

@monosoul monosoul commented Oct 20, 2023

Adds a workaround for testcontainers/testcontainers-java#6441 issue.
The issue happens when Docker was unavailable during the first attempt to start a container. All future attempts will fail, since testcontainers caches the connection attempt result in a static variable, so the state will persist while the class is loaded.
The workaround is to reset the state through reflection each time before we start the container.

@monosoul monosoul temporarily deployed to snapshot October 20, 2023 10:37 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3146995) 97.37% compared to head (6a792be) 97.41%.

❗ Current head 6a792be differs from pull request most recent head 6078aaf. Consider uploading reports for the commit 6078aaf to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #152      +/-   ##
============================================
+ Coverage     97.37%   97.41%   +0.03%     
- Complexity      138      139       +1     
============================================
  Files            26       26              
  Lines           609      618       +9     
  Branches         23       23              
============================================
+ Hits            593      602       +9     
  Misses            5        5              
  Partials         11       11              
Files Coverage Δ
...onosoul/jooq/container/GenericDatabaseContainer.kt 97.72% <100.00%> (+0.58%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

To use the snapshot version of the plugin add this to settings.gradle.kts:

pluginManagement {
  repositories {
    maven {
      name = "JooqDockerPluginSnapshotRepo"
      url = uri("https://maven.pkg.github.com/monosoul/jooq-gradle-plugin/")
      credentials {
        username = "<your GitHub username>"
        password = "<your GitHub access token with read:packages scope>"
      }
    }
    gradlePluginPortal()
  }
}

And this to build.gradle.kts:

plugins {
  id("dev.monosoul.jooq-docker") version "SNAPSHOT-1a3881e9ec38b009e46de34f3f91b0d33ae1524b"
}

@monosoul monosoul enabled auto-merge (squash) October 20, 2023 16:38
@monosoul monosoul disabled auto-merge October 20, 2023 16:38
@monosoul monosoul temporarily deployed to snapshot October 20, 2023 16:51 — with GitHub Actions Inactive
@monosoul monosoul merged commit 249ac33 into main Oct 20, 2023
3 checks passed
@monosoul monosoul deleted the fix/testcontainers-workaround branch October 20, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant