[ 
https://issues.apache.org/jira/browse/FINERACT-780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16884685#comment-16884685
 ] 

Michael Vorburger.ch commented on FINERACT-780:
-----------------------------------------------

[~mohitsinha] I'm not entirely sure that that (external) echo server actually 
really does, but through some git archology found 
https://github.com/apache/fineract/commits/c5b56dae8fc93986628301bf1b2c7f4a96fa880b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/HookIntegrationTest.java
 which seems to show that there is some prior history re. this particular test 
being flacky, and that my old friend [~avikganguly010] originally introduced 
it...

http://www.jamesward.com/2014/06/11/testing-webhooks-was-a-pain-so-i-fixed-the-glitch
 explains what it is - just somebody's test server, source code on 
https://github.com/jamesward/echo-webhook, where anyone can POST anything you 
like to, and then get it back via a GET.

{quote}What someone probably could do is to instead start some sort of Echo 
Server written in Java in-process as part of that test. Something like this may 
already exist as a library somewhere, or otherwise it probably wouldn't be 
terribly hard to write it.{quote}

Actually, couldn't we just write a very simple thing in Spring  within Fineract 
for this? Perhaps even simpler than echo-webhook.herokuapp.com, and just.. a 
super simple hard-coded class? I guess it's a little bit ugly to have it as 
part of fineract production code (if we put this class under {{src/main/java}}, 
because it won't be the WAR and run for the IT if it's elsewhere), but to me 
that would not be the end of the world an acceptable. After FINERACT-764 is 
done, such a class could perhaps be moved from {{src/main/java}} to 
{{src/integrationTest}}, if Spring Boot picks up from there when it runs ITs 
(but it would then not be in the final WAR).

> HookIntegrationTest is flaky
> ----------------------------
>
>                 Key: FINERACT-780
>                 URL: https://issues.apache.org/jira/browse/FINERACT-780
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: Michael Vorburger.ch
>            Priority: Major
>
> Our org.apache.fineract.integrationtests.HookIntegrationTest seems to be 
> "flaky" and occassionally arbitrary fails.
> This seems to have happened e.g. in 
> https://github.com/apache/fineract/pull/557 as well as again in 
> https://github.com/apache/fineract/pull/607.
> I suspect it's related to this in the code of that test:
> {code:java}
> // Subject to https://echo-webhook.herokuapp.com being up
> // See
> // 
> http://www.jamesward.com/2014/06/11/testing-webhooks-was-a-pain-so-i-fixed-the-glitch
> final String payloadURL = 
> "http://echo-webhook.herokuapp.com:80/Z7RXoCBdLSFMDrpn?";;
> this.hookHelper.createHook(payloadURL);
> {code}
> In an ideal world, even an integration test should not depend on an external 
> service running on some arbitrary 3rd party website.
> What someone probably could do is to instead start some sort of Echo Server 
> written in Java in-process as part of that test. Something like this may 
> already exist as a library somewhere, or otherwise it probably wouldn't be 
> terribly hard to write it.
> If this happens more often, perhaps just temporarily adding an {{@Igore}} for 
> this test would be in order (until someone can do above).



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to