-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add unit test basics for URLFrontier. #984
Conversation
Signed-off-by: Felix Engl <felix.engl@uni-bamberg.de>
Signed-off-by: Felix Engl <felix.engl@uni-bamberg.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please base this PR against the latest main branch now that I merged your other PR? It will be a lot cleaner and easier to review.
...nal/urlfrontier/src/test/java/com/digitalpebble/stormcrawler/urlfrontier/StatusBoldTest.java
Outdated
Show resolved
Hide resolved
I realized that we get a suppressed error when running the test with the code in the commit but the same test works just fine with the changes in #980
I think this is related to starvation / async problems. Do you have an idea how we could test this properly? |
Signed-off-by: Felix Engl <felix.engl@uni-bamberg.de>
…RLFrontier_AddFirstTest
...frontier/src/test/java/com/digitalpebble/stormcrawler/urlfrontier/StatusUpdaterBoltTest.java
Show resolved
Hide resolved
|
||
@Before | ||
public void before() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not have to change a hardcoded version number in a class when it won't be used most of the time. Let's do this instead - it works fine.
String image = "crawlercommons/url-frontier";
String version = System.getProperty("urlfrontier-version");
if (version != null)
image += ":" + version;
urlFrontierContainer = new URLFrontierContainer(image);
urlFrontierContainer.start();
public void canAckASimpleTuple() | ||
throws ExecutionException, InterruptedException, TimeoutException { | ||
|
||
Configurator.setLevel(StatusUpdaterBolt.class, Level.ALL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log4j - please remove alongside any other use of it and rely on slf4j instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slf4j does not give the option to set a global logging level like log4j.
Should I drop it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about something like this (not tested)
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
loggerContext.getLogger("com.digitalpebble.stormcrawler.urlfrontier").setLevel(Level.TRACE);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I'll try it when I get home!
I can reproduce the issue. Not sure why it is happening but it doesn't matter too much. If it can be solved later on, then it would be good but we can go ahead with this PR nonetheless |
It is fixed with the other related PR. The fix already running in production (inhouse). But as you said, we can talk about it if we reach that point. |
@FelixEngl have merged it and will fix the couple of comments shortly. Thanks a lot for your work on this |
Adds basics for Unit-Testing the URLFrontier and a test for ACKing of the URLItems. (The classes Constants.java and ChannelManager.java are from #982)
Signed-off-by: Felix Engl felix.engl@uni-bamberg.de
Thanks for contributing to StormCrawler, your efforts are appreciated!
Developer Certificate of Origin
By contributing to StormCrawler, you accept and agree to the following terms and conditions (the Developer Certificate of Origin) for your present and future contributions submitted to StormCrawler.
Please refer to the Developer Certificate of Origin section in
CONTRIBUTING.md
for details.Before opening a PR, please check that:
Thanks!