tag:help.appveyor.com,2012-11-13:/discussions/problems/1998-test-failAppVeyor: Discussion 2018-10-19T08:17:09Ztag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T19:41:08Z2015-04-16T19:41:08ZTest fail<div><p>Looks like it could be accessed from Pro environment: <a href="https://ci.appveyor.com/project/FeodorFitsner/simple-console/build/1.0.435#L5">
https://ci.appveyor.com/project/FeodorFitsner/simple-console/build/...</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T20:10:17Z2015-04-16T20:10:17ZTest fail<div><p>I tried with https... but still failing...</p>
<p>The timeout is 10sec... Your test takes 5s...</p>
<p>
Foconet.Services.Test.Business.UrlCallProcessTest.TestAGoogleCall<br>
Foconet.Services.Test.DLL<br>
10 sec 305 ms<br>
Foconet.Services.Test.Business.UrlCallProcessTest.TestAInvalidPageAtGoogleCall<br>
Foconet.Services.Test.DLL<br>
10 sec 2 ms</p>
<p>2015-04-16 16:41 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T20:12:46Z2015-04-16T20:12:46ZTest fail<div><p>What exact URL do you call and what code do you use to call
it?</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T20:30:11Z2015-04-16T20:30:11ZTest fail<div><p>the url,<br>
1) <a href="https://www.google.com">https://www.google.com</a> read
the title<br>
2) <a href="https://www.google.com/123">https://www.google.com/123</a> read
error on the body.</p>
<p>Is the client we use to call rest APIs, on server... the code is
base this</p>
<p>{ try { var request = WebRequest.Create(url); request.Method =
method; request.ContentLength = 0; request.Timeout = TIMEOUT;</p>
<pre>
<code> using (var response = (HttpWebResponse)await</code>
</pre>
<p>request.GetResponseAsync())<br>
{ using (var stream = response.GetResponseStream()) { if (stream ==
null) return new ResponseContent { Body = "No content on response",
StatusCode = HttpStatusCode.NoContent };</p>
<pre>
<code> using (var reader = new StreamReader(stream))
{
var responseContent = new ResponseContent();
var body = await reader.ReadToEndAsync();
responseContent.StatusCode =</code>
</pre>
<p>response.StatusCode;<br>
responseContent.Body = body; return responseContent; } } }</p>
<pre>
<code> }
catch (Exception err)
{
LOGGER.ErrorFormat("Error on requesto to {0}", url);
LOGGER.Error(err);
return new ResponseContent(err);
}
}
protected class ResponseContent
{
public ResponseContent()
{
}
public ResponseContent(Exception err)
{
this.Body = err.Message;
var exception = err as WebException;
this.StatusCode = exception != null
?</code>
</pre>
<p>((HttpWebResponse)exception.Response).StatusCode :
HttpStatusCode.InternalServerError; }</p>
<pre>
<code> public HttpStatusCode StatusCode { get; set; }
public string Body { get; set; }
}</code>
</pre>
<p>2015-04-16 17:12 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T20:45:53Z2015-04-16T20:45:53ZTest fail<div><p>OK, thanks. Will try to reproduce the test. I assume you are
riunning builds on Pro environment, right?</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T20:47:46Z2015-04-16T20:47:46ZTest fail<div><p>I hope so</p>
<p>Current plan<br>
Pro</p>
<p>2015-04-16 17:45 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T20:49:22Z2015-04-16T20:49:23ZTest fail<div><p>My e-mail on the appvoyer is <a href="mailto:ggrocco@gmail.com">ggrocco@gmail.com</a><br>
Thanks!</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T20:51:22Z2015-04-16T20:51:22ZTest fail<div><p>Great, thanks.</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-16T23:15:04Z2015-04-16T23:15:04ZTest fail<div><p>I've tested with <code>WebClient</code> and
<code>HttpClient</code> for now. It worked like a charm: <a href="https://ci.appveyor.com/project/FeodorFitsner/iisexpress-tests/build/1.0.16">
https://ci.appveyor.com/project/FeodorFitsner/iisexpress-tests/buil...</a>
It was successful like 3 times in a row.</p>
<p>Tests: <a href="https://github.com/FeodorFitsner/iisexpress-tests/blob/master/IIsExpressTests/MyTests.cs#L40-L82">
https://github.com/FeodorFitsner/iisexpress-tests/blob/master/IIsEx...</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T05:51:57Z2015-04-17T05:51:57ZTest fail<div><p>@ Georgeo Rocco - do you have a proxy setting in an
<code>app.config</code> or <code>web.config</code> file
somewhere?</p></div>Pure Krometag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T13:44:42Z2015-04-17T13:44:42ZTest fail<div><p>No, I don't have proxy configured!</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T18:55:47Z2015-04-17T18:55:47ZTest fail<div><p>Still not working... Has a way to print the log on appveyor
console? I<br>
split code in many test and look is losing something on some async
... and<br>
lose control! The test takes more then 20 min to stop on
timeout....</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T19:14:27Z2015-04-17T19:14:27ZTest fail<div><p>I've added two more tests using <code>WebRequest</code> class:
<a href="https://github.com/FeodorFitsner/iisexpress-tests/blob/master/IIsExpressTests/MyTests.cs#L84-L123">
https://github.com/FeodorFitsner/iisexpress-tests/blob/master/IIsEx...</a></p>
<p>They both succeed in allowed timeout interval: <a href="https://ci.appveyor.com/project/FeodorFitsner/iisexpress-tests/build/1.0.19">
https://ci.appveyor.com/project/FeodorFitsner/iisexpress-tests/buil...</a></p>
<p>I guess it's something in your tests, not a connectivity issue
to google.com.</p>
<p>So, what exact exception are you getting? What testing framework
using? How does entire test look like?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T19:19:19Z2015-04-17T19:19:20ZTest fail<div><p>This is the problem! I'm not getting a exception... or I set the
timeout<br>
and get test fail, or run forever!<br>
I'm using xunit 2.0.0.2929, .Net 4.5.2.</p>
<p>I don't know how get feedback from the ci, has any log4net
appender for put<br>
a lot of messages and try to understand where is losing the
control?</p>
<p>2015-04-17 16:14 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T19:21:43Z2015-04-17T19:21:43ZTest fail<div><p>You can try writing to a file or redirect trace to a file if you
have. Then you can login via RDP to see what's going on there:
<a href="https://github.com/appveyor/ci/blob/master/scripts/enable-rdp.ps1">
https://github.com/appveyor/ci/blob/master/scripts/enable-rdp.ps1</a></p>
<p>Where do you put that timeout?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T19:31:49Z2015-04-17T19:31:49ZTest fail<div><p>Lol it's something on .Net or Xunit, try run this in Release
Mode... I'm<br>
getting now the same error. I will try to understand what is
happen!<br>
Sorry!!!</p>
<p>2015-04-17 16:21 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T19:33:34Z2015-04-17T19:33:35ZTest fail<div><p>Sorry was not the! I run again and now is passing... :(! I Will
try connect<br>
to server and check what is happen!</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T20:23:25Z2015-04-17T20:23:25ZTest fail<div><p>Is losing control on third using, send but never back... any
idea?</p>
<p>using (var client = new HttpClient { Timeout =
TimeSpan.FromSeconds(timeoutSenconds) })<br>
{ using (var request = new
HttpRequestMessage(method.GetHttpMethod(), url))<br>
{ using (var result = await client.SendAsync(request)) {</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T20:27:06Z2015-04-17T20:27:06ZTest fail<div><p>How does containing method look like and how it's called? Looks
like an issue with using async-await pattern.</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T20:34:50Z2015-04-17T20:34:50ZTest fail<div><p>I test many times on the VM, after some test works... the code
don't<br>
change... If is issue on using async-await pattern, will not
work<br>
anywhere... but works here in all machines...</p>
<p>2015-04-17 17:27 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T21:41:22Z2015-04-17T21:41:22ZTest fail<div><p>@Feodor - could this possibly be related to my 'test hanging'
issue also?</p></div>Pure Krometag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T21:45:22Z2015-04-17T21:45:22ZTest fail<div><p>I don't know. But as it's failing/hanging on awaitable method
call I'd like to reproduce that on a smaller test if possible. I
guess method containing that code is async and I'm wondering how
it's being called in a test.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-17T21:52:08Z2015-04-17T21:52:08ZTest fail<div><p>Hangs on <code>async/await</code> happen (for me) when I do crap
code like <code>.Result</code> in an ASP.NET project (ie. ASP.NET
context). All this crap about deadlocks with the wrong
<em>context</em> and crap. Works in console, fails in other
scenario's.</p>
<p>Lord Of Async/Await :: <a href="http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html">
http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html</a></p>
<p>Now, maybe with xUnit 2.0 and the runner we're using in AV ..
this deadlock behavior is occuring again?</p>
<p>(Note: i'm guessing and i'm not sure how to fix this. As a
related note, my issue with Hanging could be related because i'm
<em>also</em> doing <code>async/await</code> in my tests. Where
there's smoke, there's fire...)</p></div>Pure Krometag:help.appveyor.com,2012-11-13:Comment/366012892015-04-19T18:07:21Z2015-04-19T18:07:21ZTest fail<div><p>Could you drop me a link to one of your tests using
async/await?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-20T15:27:31Z2015-04-20T15:27:31ZTest fail<div><p>Hi Feodor, I copy and paste the code and the test, don´t
change nothing!<br>
And works! This make sad!<br>
<a href="https://github.com/ggrocco/TestAppVeyor">https://github.com/ggrocco/TestAppVeyor</a><br>
<a href="https://ci.appveyor.com/project/Foco/testappveyor">https://ci.appveyor.com/project/Foco/testappveyor</a></p>
<p>I really believe is something magic lol. But still not working
in my<br>
project.</p>
<p>2015-04-19 15:07 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-20T16:03:53Z2015-04-20T16:03:53ZTest fail<div><p>I download the xunit.console and run...</p>
<p>C:\Sources\Foconet [fix-tests]> xunit.console.x86<br>
.\test\Foconet.Tools.Test\bin\Release\Foconet.Tools.Test.dll
xUnit.net console test runner (32-bit .NET 4.0.30319.34209)<br>
Copyright (C) 2015 Outercurve Foundation.</p>
<p>Discovering: Foconet.Tools.Test<br>
Discovered: Foconet.Tools.Test<br>
Starting: Foconet.Tools.Test<br>
Finished: Foconet.Tools.Test</p>
<p>=== TEST EXECUTION SUMMARY === Foconet.Tools.Test Total: 135,
Errors: 0, Failed: 0, Skipped: 0, Time: 3,670s<br>
C:\Sources\Foconet [fix-tests]></p>
<p>the test pass... this is insane no?!?!?</p></div>Georgeo Roccotag:help.appveyor.com,2012-11-13:Comment/366012892015-04-20T17:43:55Z2015-04-20T17:43:55ZTest fail<div><p>Thanks for providing sample app for reproducing the issue. I see
there is only one test method, but what if you have like a dozen of
similar tests or so. Maybe then we could see some sort of racing
condition. Could you try that please?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/366012892015-04-20T19:59:03Z2015-04-20T19:59:04ZTest fail<div><p>I know racing condition is very difficult to detect, but this
looks like<br>
more some environments issues than a RC problem.</p>
<p>Is a .Net functionality, my method a static method and don't use
lock, and<br>
don't shared state...</p>
<p>I will try two things... first is generate the artifacts with
all dll<br>
builds and run in my machine, second run by command line on
CI....</p>
<p>2015-04-20 14:43 GMT-03:00 Feodor Fitsner <a href="mailto:tender2+d9f092fa24@tenderapp.com">tender2+d9f092fa24@tenderapp.com</a><br>
:</p></div>Georgeo Rocco