question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to reuse the test container between tests with the new version 2.1.1 (KC 17)

See original GitHub issue

Hello,

It seems since version 2.x test container cannot be reused between tests. The next test cannot reuse the test container which was not stopped (stop() method not called).

We have an exception indicating the test realm cannot be imported (because already/previously imported)

2022-03-14 10:32:01,910 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (executor-thread-2) Unique index or primary key violation: "PRIMARY_KEY_62 ON PUBLIC.REALM(ID) VALUES ('test', 23)"; SQL statement:
insert into REALM (ACCESS_CODE_LIFESPAN, LOGIN_LIFESPAN, USER_ACTION_LIFESPAN, ACCESS_TOKEN_LIFESPAN, ACCESS_TOKEN_LIFE_IMPLICIT, ACCOUNT_THEME, ADMIN_EVENTS_DETAILS_ENABLED, ADMIN_EVENTS_ENABLED, ADMIN_THEME, ALLOW_USER_MANAGED_ACCESS, BROWSER_FLOW, CLIENT_AUTH_FLOW, DEFAULT_LOCALE, DEFAULT_ROLE, DIRECT_GRANT_FLOW, DOCKER_AUTH_FLOW, DUPLICATE_EMAILS_ALLOWED, EDIT_USERNAME_ALLOWED, EMAIL_THEME, ENABLED, EVENTS_ENABLED, EVENTS_EXPIRATION, INTERNATIONALIZATION_ENABLED, LOGIN_THEME, LOGIN_WITH_EMAIL_ALLOWED, MASTER_ADMIN_CLIENT, NAME, NOT_BEFORE, OFFLINE_SESSION_IDLE_TIMEOUT, OTP_POLICY_ALG, OTP_POLICY_DIGITS, OTP_POLICY_COUNTER, OTP_POLICY_WINDOW, OTP_POLICY_PERIOD, OTP_POLICY_TYPE, PASSWORD_POLICY, REFRESH_TOKEN_MAX_REUSE, REGISTRATION_ALLOWED, REG_EMAIL_AS_USERNAME, REGISTRATION_FLOW, REMEMBER_ME, RESET_CREDENTIALS_FLOW, RESET_PASSWORD_ALLOWED, REVOKE_REFRESH_TOKEN, SSL_REQUIRED, SSO_IDLE_TIMEOUT, SSO_IDLE_TIMEOUT_REMEMBER_ME, SSO_MAX_LIFESPAN, SSO_MAX_LIFESPAN_REMEMBER_ME, VERIFY_EMAIL, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-197]

Could you please check that ?

Regards

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dasnikocommented, Mar 15, 2022

Thanks for this issue. I’ll investigate into it in the next days. I know already what’s going on, but I need some time to fix it.

0reactions
dasnikocommented, Mar 15, 2022

merged into main

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to reuse Testcontainers between multiple ...
Try to place container instance into separate @TestConfiguration as a @Bean and then import this configuration in all your relevant tests. – ...
Read more >
Unable to run test containers with Apple Silicon Mac #3834
I'm on testcontainers version 1.16.0 and it still does not work on my M1 Mac. ➜ ~ java -version openjdk version "11.0.10" 2021- ......
Read more >
Reuse Containers With Testcontainers for Fast Integration Tests
Reuse Docker containers with Testcontainers to save initial setup time for Testcontainers to start and accerlate your build times.
Read more >
Faster Integration Tests with Reusable Testcontainers | Foojay.io
Learn how to improve your test performance against container-based resources by magnitudes in a couple of easy steps!
Read more >
afspcman91-710v3 - Air Force
It establishes the system safety program requirements, minimum design, test, inspection, hazard analyses, and data requirements for hazardous ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found