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.

wait on log ending too fast, would be nice to be able to add some delay

See original GitHub issue

Description

We have this problem for some time with several recent version of our plug-in, which is that:

  • Setup: If my maven job is to use this plug-in to spin up a postgres docker container then run some dao tests against the postgres database. And the plug-in is set as wait on log such as:
    <wait>
              <log>database system is ready to accept connections</log>
              <time>20000</time>
    </wait>
    
  • Problem: Then occasionally, maybe 30% to 50% of the time (sometimes more frequent), that those dao tests cannot be carried out because when spring boots up the datasource immediately after the database container showing log database system is ready to accept connections, the datasource cannot connect onto database (it seems still need some micro delay to be ready).

We have errors then such as: Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: FATAL: the database system is starting up

Solution?

It would be nice to be able to add some option to set the delay after some log has appear.

Other info …

  • Maven version (mvn -v) :
Listening for transport dt_socket at address: 63099
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_72, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.1", arch: "x86_64", family: "mac"
  • Docker version : Docker version 1.11.2, build b9f10c9

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rhusscommented, Mar 25, 2017

I just added multi line matching so that you can wait now (forthcoming release 0.20.1) with

"(?s)ready to accept connections.*ready to accept connections"

so that the checks wait until of the second connection string appears.

0reactions
michael-simonscommented, Mar 31, 2017

Works fine for me. Thank you very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

wait on log ending too fast, would be nice to be able to add some ...
We have this problem for some time with several recent version of our plug-in, which is that: Setup: If my maven job is...
Read more >
Avoiding hard waits in Playwright and Puppeteer
Hard waits do one thing and one thing only: wait for the specified amount of time. There is nothing more to them. This...
Read more >
Touch & hold delay - Android Accessibility Help
A longer touch & hold delay means that you need to keep your finger in the same place for longer before your tap...
Read more >
Python sleep(): How to Add Time Delays to Your Code
Have you ever needed to make your Python program wait for something? Most of the time, you'd want your code to execute as...
Read more >
Scheduling: setTimeout and setInterval
We may decide to execute a function not right now, ... Again, there is no universal specification for these methods, so that's fine....
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