Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-08 Thread Adrian Cole
Yep

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-58364504

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-08 Thread Andrew Phillips
@adriancole Can this be closed now..?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-58357458

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-03 Thread Adrian Cole
ok, well another hammer is the Timeout annotation on the test...


Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-03 Thread Andrew Phillips
> maybe wrong place to discuss, but at square, we used an annotation @Flakey 
> which would simply 
> replay the test on failure.

The thing here is that this test doesn't _fail_, it causes the build to _hang_. 
But for some of our other flaky tests...sure!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-57831347

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-03 Thread Andrew Phillips
> I haven't seen the problem occur recently

Looks like I was a bit too optimistic, and that is **not** fixed by the change 
to longs:

https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1206/console

hanging at:
```
Test suite progress: tests succeeded: 69, failed: 0, skipped: 0.
Starting test 
testZeroLengthPutHasContentLengthHeader(org.jclouds.s3.S3ClientMockTest)
Oct 03, 2014 12:30:50 PM com.squareup.okhttp.mockwebserver.MockWebServer$3 
processOneRequest
INFO: Received request: PUT /bucket/object HTTP/1.1 and responded: HTTP/1.1 200 
OK
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-57829446

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-02 Thread Andrew Phillips
> @@ -280,7 +280,6 @@ protected void writeNothing(HttpURLConnection connection) 
> {
>   // HttpUrlConnection strips Content-Length: 0 without 
> setDoOutput(true)
>   String method = connection.getRequestMethod();
>   if ("POST".equals(method) || "PUT".equals(method)) {
> -connection.setFixedLengthStreamingMode(0);

> Whoops the line that is removed here was the one I was talking about anyway!

Just to make sure I'm understanding you correctly: you're not proposing to 
remove the `setFixedLength...` bit, are you?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502/files#r18327733

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-01 Thread Andrew Phillips
> @@ -280,7 +280,6 @@ protected void writeNothing(HttpURLConnection connection) 
> {
>   // HttpUrlConnection strips Content-Length: 0 without 
> setDoOutput(true)
>   String method = connection.getRequestMethod();
>   if ("POST".equals(method) || "PUT".equals(method)) {
> -connection.setFixedLengthStreamingMode(0);

>  I would just rebase this, switch 0 to 0L and merge. 

It's [already a 
long](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java#L283).
 I haven't seen the problem occur recently - will keep monitoring: if it's 
gone, great, otherwise the long switch unfortunately doesn't seem to be the 
problem ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502/files#r18320249

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-10-01 Thread Ignasi Barrera
> @@ -280,7 +280,6 @@ protected void writeNothing(HttpURLConnection connection) 
> {
>   // HttpUrlConnection strips Content-Length: 0 without 
> setDoOutput(true)
>   String method = connection.getRequestMethod();
>   if ("POST".equals(method) || "PUT".equals(method)) {
> -connection.setFixedLengthStreamingMode(0);

In master (which will become 2.0) we don't support Java 6 anymore, so I'm +1 to 
switching to long.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502/files#r18282269

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-30 Thread Andrew Phillips
> @@ -280,7 +280,6 @@ protected void writeNothing(HttpURLConnection connection) 
> {
>   // HttpUrlConnection strips Content-Length: 0 without 
> setDoOutput(true)
>   String method = connection.getRequestMethod();
>   if ("POST".equals(method) || "PUT".equals(method)) {
> -connection.setFixedLengthStreamingMode(0);

Interesting! The [internal code 
paths](http://www.docjar.com/html/api/java/net/HttpURLConnection.java.html) 
certainly don't obviously appear to merge quickly.

According to the Javadoc, it seems the long version [is the way to 
go](http://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html#setFixedLengthStreamingMode\(int\)),
 although the int version certainly isn't deprecated.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502/files#r18262788

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-30 Thread Adrian Cole
another way out is to change S3ClientMockTest to use okhttp's http driver. I 
would highly doubt that fails.

Anyway this might be simple enough to reproduce, as MWS has a similar test 
already.  
https://github.com/square/okhttp/blob/master/mockwebserver/src/test/java/com/squareup/okhttp/mockwebserver/MockWebServerTest.java#L148
 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-57422700

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-30 Thread Adrian Cole
> @@ -280,7 +280,6 @@ protected void writeNothing(HttpURLConnection connection) 
> {
>   // HttpUrlConnection strips Content-Length: 0 without 
> setDoOutput(true)
>   String method = connection.getRequestMethod();
>   if ("POST".equals(method) || "PUT".equals(method)) {
> -connection.setFixedLengthStreamingMode(0);

ps. shot in the dark, but isn't this the method that was later overloaded with 
a long parameter? wonder if that has anything to do with it.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502/files#r18262451

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-30 Thread Adrian Cole
I don't think it is a good idea to revert the fixedlengthstreaming mode. I can 
see how I could have left a comment more descriptive than urlconnection will 
screw up if we don't do this, but if need be I can dig more into what the 
original issue with this was. best I can recall, it was a jdk 6 vs 7 thing.

I'll look into this on thursday.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-57421606

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-30 Thread Andrew Phillips
@adriancole Seeing as you seem to be online...ping? ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-57419450

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-25 Thread Andrew Phillips
> @@ -280,7 +280,6 @@ protected void writeNothing(HttpURLConnection connection) 
> {
>   // HttpUrlConnection strips Content-Length: 0 without 
> setDoOutput(true)
>   String method = connection.getRequestMethod();
>   if ("POST".equals(method) || "PUT".equals(method)) {
> -connection.setFixedLengthStreamingMode(0);

@andrewgaul: I finally got round to mentioning this to @adriancole today and he 
recalls that this was probably set explicitly to ensure consistent behaviour 
across JDK types and versions and probably shouldn't be changed - especially to 
fix a test.

He also mentioned that he would try to have a look at this and fix MWS, if the 
problem turns out to be there.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502/files#r18075481

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-07 Thread Andrew Gaul
We need to find a way forward on these MWS hangs.  Either disable the suspect 
test temporarily or push forward with this commit.  Any preference?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-54778403

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-05 Thread Andrew Phillips
@adriancole Ping? ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-54694735

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-02 Thread Andrew Phillips
> @@ -280,7 +280,6 @@ protected void writeNothing(HttpURLConnection connection) 
> {
>   // HttpUrlConnection strips Content-Length: 0 without 
> setDoOutput(true)
>   String method = connection.getRequestMethod();
>   if ("POST".equals(method) || "PUT".equals(method)) {
> -connection.setFixedLengthStreamingMode(0);

cd79a9d8 very expressly set these two values at the same time. I unfortunately 
can't find any obvious hints as to why this was required and/or whether 
something has changed between 6 and 7 that would make this one unnecessary, but 
I'd be hesitant to remove it without some more input.

@adriancole Since the original commit was from you...any light you could shine 
on this?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502/files#r16994605

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-01 Thread CloudBees pull request builder plugin
[jclouds-pull-requests 
#1134](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1134/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-54115165

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-01 Thread BuildHive
[jclouds ยป jclouds 
#1579](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/1579/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-54114116

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-01 Thread CloudBees pull request builder plugin
[jclouds-pull-requests-java-6 
#45](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests-java-6/45/) 
SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-54111870

Re: [jclouds] Work around mockwebserver hangs in S3 tests (#502)

2014-09-01 Thread Andrew Gaul
Tested with 100 iterations of: 
`S3ClientMockTest.testZeroLengthPutHasContentLengthHeader`.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/502#issuecomment-54111810