-
-
Notifications
You must be signed in to change notification settings - Fork 233
Simplify log-wait-strategy #977
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
Simplify log-wait-strategy #977
Conversation
✅ Deploy Preview for testcontainers-node ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The refactor looks great! Looks like a test is failing just because the One Q: I'm pretty sure that removing byline can result in an intermittent issue. E.g let's say we're looking for the message "Started successfully!". It's possible we get that message in 2 chunks, e.g "Started" and " successfully!". Without buffering into a single line we would not match the message. |
I'll fix the tests when I'm back at my PC later |
The message should be exactly the same so I'll fix that. On the bylines side, I'd argue for an actual example/real use case. Even if you do echo -n, the shell will buffer the output by line, same with python and node I believe. The only real world example I have seen in the wild is with binary outputs and you don't need new lines Even if you did need it, you don't need a library to do it. with an iterator it's a couple of lines of code at worst, so less lines of code than using that library! |
Hey @cristianrgreco I've added tests for both the message not being found and also for if the content is not sent in a single line and they all pass (without need to bylines). Please have a look and let me know what you think? |
So I readded byline even though the test passes with or without it |
packages/testcontainers/src/wait-strategies/log-wait-strategy.ts
Dismissed
Show dismissed
Hide dismissed
packages/testcontainers/src/wait-strategies/log-wait-strategy.ts
Dismissed
Show dismissed
Hide dismissed
The changes LGTM. I had a doubt about removing the Are there any other changes you wanna make or are we good to merge? |
Good from me! |
…d concerns, handled more timing edge cases. More details in the pull request
…d test to for this case to LogWaitrStrategy
660fc5b
to
f5231e1
Compare
This reverts commit b837e90.
This pull request simplifies the log-wait-strategy in a number of ways:
I'd also argue that it is a lot easier to read!