Re: Review Request 53803: Added a new libprocess HTTP test.

2016-12-08 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Dec. 8, 2016, 9:42 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Changes
---

Addressed Joseph's comments.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description
---

This patch adds HTTPTest.SocketEOF to verify that EOFs are
reliably received whether or not there is a pending recv()
request at the time the EOF is received.


Diffs (updated)
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
f4c5dd6dd175b4b91a9517a280a0013fd588752f 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-12-07 Thread Joseph Wu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/#review158485
---




3rdparty/libprocess/src/tests/http_tests.cpp (lines 15 - 16)


Is this header still required?



3rdparty/libprocess/src/tests/http_tests.cpp (lines 222 - 224)


Why are both of these inner scopes in the same test?  They could be 
entirely separate tests, right?



3rdparty/libprocess/src/tests/http_tests.cpp (line 238)


This will run into an error on Windows, as the `server_address` is the 
(invalid) 0.0.0.0 IP.

See: 
https://github.com/apache/mesos/blob/1350f946a3aa12e9b2b66720e81b5a4ba4c4d90d/3rdparty/libprocess/src/tests/http_tests.cpp#L1784-L1794

Ditto in the second block.


- Joseph Wu


On Dec. 6, 2016, 11:28 a.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53803/
> ---
> 
> (Updated Dec. 6, 2016, 11:28 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Joseph Wu.
> 
> 
> Bugs: MESOS-5966
> https://issues.apache.org/jira/browse/MESOS-5966
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch adds HTTPTest.SocketEOF to verify that EOFs are
> reliably received whether or not there is a pending recv()
> request at the time the EOF is received.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/tests/http_tests.cpp 
> 7f5425742d554b78fd4788c4a453068a604e1f46 
> 
> Diff: https://reviews.apache.org/r/53803/diff/
> 
> 
> Testing
> ---
> 
> Testing details are at the end of this review chain.
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-12-06 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Dec. 6, 2016, 7:28 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Changes
---

Rebase.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description
---

This patch adds HTTPTest.SocketEOF to verify that EOFs are
reliably received whether or not there is a pending recv()
request at the time the EOF is received.


Diffs (updated)
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
7f5425742d554b78fd4788c4a453068a604e1f46 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-30 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Nov. 30, 2016, 11:14 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Changes
---

Rebase.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description
---

This patch adds HTTPTest.SocketEOF to verify that EOFs are
reliably received whether or not there is a pending recv()
request at the time the EOF is received.


Diffs (updated)
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
de22d20d84cd254c2d96e3951e95a63063cb85d3 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-30 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Nov. 30, 2016, 5:57 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description
---

This patch adds HTTPTest.SocketEOF to verify that EOFs are
reliably received whether or not there is a pending recv()
request at the time the EOF is received.


Diffs
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
533104c93dd1eaf67bf3752163d2e0cad090078d 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-23 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Nov. 23, 2016, 6:18 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description (updated)
---

This patch adds HTTPTest.SocketEOF to verify that EOFs are
reliably received whether or not there is a pending recv()
request at the time the EOF is received.


Diffs
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
533104c93dd1eaf67bf3752163d2e0cad090078d 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-23 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Nov. 23, 2016, 6:17 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Changes
---

Addressed BenM's comments.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description (updated)
---

Added a new libprocess HTTP test.


Diffs (updated)
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
533104c93dd1eaf67bf3752163d2e0cad090078d 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-23 Thread Greg Mann


> On Nov. 23, 2016, 1:26 a.m., Benjamin Mahler wrote:
> > 3rdparty/libprocess/src/tests/http_tests.cpp, lines 203-204
> > 
> >
> > A lot of these comments seem to have a really long line followed by a 
> > really short line. I would suggest trying to wrap these comments to be a 
> > little less "jagged", as I find it's easier on the eyes, but up to you:
> > 
> > ```
> > // This test verifies that an EOF sent on a socket will be correctly 
> > received by
> > // the other end.
> > ```
> > 
> > vs.
> > 
> > ```
> > // This test verifies that an EOF sent on a socket
> > // will be correctly received by the other end.
> > ```
> > 
> > Ditto below.

Agreed!


- Greg


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/#review156677
---


On Nov. 23, 2016, 6:17 p.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53803/
> ---
> 
> (Updated Nov. 23, 2016, 6:17 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Joseph Wu.
> 
> 
> Bugs: MESOS-5966
> https://issues.apache.org/jira/browse/MESOS-5966
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Added a new libprocess HTTP test.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/tests/http_tests.cpp 
> 533104c93dd1eaf67bf3752163d2e0cad090078d 
> 
> Diff: https://reviews.apache.org/r/53803/diff/
> 
> 
> Testing
> ---
> 
> Testing details are at the end of this review chain.
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-23 Thread Greg Mann


> On Nov. 23, 2016, 1:26 a.m., Benjamin Mahler wrote:
> > 3rdparty/libprocess/src/tests/http_tests.cpp, lines 203-205
> > 
> >
> > This should be a SocketTest.ReceiveEOF within socket_tests.cpp? There 
> > doesn't appear to be any HTTP involved here and we're just interested in 
> > the socket behavior.

socket_tests.cpp is a file in stout with little contents - I decided to put the 
new test here rather than splitting out a new libprocess tests file, but we 
could do that as well. Do you think we should introduce a new file for this 
test?


- Greg


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/#review156677
---


On Nov. 16, 2016, 7:20 p.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53803/
> ---
> 
> (Updated Nov. 16, 2016, 7:20 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Joseph Wu.
> 
> 
> Bugs: MESOS-5966
> https://issues.apache.org/jira/browse/MESOS-5966
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch adds HTTPTest.SocketEOF to verify that EOFs are
> reliably received whether or not there is a pending recv()
> request at the time the EOF is received.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/tests/http_tests.cpp 
> 533104c93dd1eaf67bf3752163d2e0cad090078d 
> 
> Diff: https://reviews.apache.org/r/53803/diff/
> 
> 
> Testing
> ---
> 
> Testing details are at the end of this review chain.
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-22 Thread Benjamin Mahler

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/#review156677
---



Thanks for taking on this issue and testing it!


3rdparty/libprocess/src/tests/http_tests.cpp (lines 203 - 205)


This should be a SocketTest.ReceiveEOF within socket_tests.cpp? There 
doesn't appear to be any HTTP involved here and we're just interested in the 
socket behavior.



3rdparty/libprocess/src/tests/http_tests.cpp (lines 203 - 204)


A lot of these comments seem to have a really long line followed by a 
really short line. I would suggest trying to wrap these comments to be a little 
less "jagged", as I find it's easier on the eyes, but up to you:

```
// This test verifies that an EOF sent on a socket will be correctly 
received by
// the other end.
```

vs.

```
// This test verifies that an EOF sent on a socket
// will be correctly received by the other end.
```

Ditto below.



3rdparty/libprocess/src/tests/http_tests.cpp (lines 210 - 212)


Is it possible to just use the try directly?

```
Try client = Socket::create();
ASSERT_SOME(client);

...

client->recv();
```

Ditto below for the server socket:

```
Try server = Socket::create();
ASSERT_SOME(server);

server->bind(Address());
```

Ditto for the Address, can you use it via the Try instead of pulling out 
another variable?



3rdparty/libprocess/src/tests/http_tests.cpp (lines 218 - 219)


Can you use explicit shutdowns instead of relying on the scoping?



3rdparty/libprocess/src/tests/http_tests.cpp (line 225)


Using the default constructor seems a little less clear than:

```
server.bind(Address::LOCALHOST_ANY())
```

Also can you check the result? And could you just use the result to avoid 
the need to call server.address()?

```
Try server_address = server.bind(Address::LOCALHOST_ANY());

ASSERT_SOME(server_address);

...
// use it: server_address.get();
```



3rdparty/libprocess/src/tests/http_tests.cpp (lines 237 - 240)


Can this just be:

```
AWAIT_READY(server_socket.send(data));
AWAIT_EXPECT_EQ(data, client_socket.recv(data.size()));
```

Or is there some reason you wanted to call recv first? If so, a comment 
would be great. Note that you don't need the '`receive`' variable to be in the 
outer scope.



3rdparty/libprocess/src/tests/http_tests.cpp (lines 243 - 248)


Oh, can you just put your shutdown code before this patch?



3rdparty/libprocess/src/tests/http_tests.cpp (lines 250 - 252)


Can this just be:

```
AWAIT_EXPECT_EQ("", client_socket.recv());
```

i.e. why do you need to pass 1? and doesn't look like you need to store the 
future in a variable?


- Benjamin Mahler


On Nov. 16, 2016, 7:20 p.m., Greg Mann wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53803/
> ---
> 
> (Updated Nov. 16, 2016, 7:20 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Joseph Wu.
> 
> 
> Bugs: MESOS-5966
> https://issues.apache.org/jira/browse/MESOS-5966
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This patch adds HTTPTest.SocketEOF to verify that EOFs are
> reliably received whether or not there is a pending recv()
> request at the time the EOF is received.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/tests/http_tests.cpp 
> 533104c93dd1eaf67bf3752163d2e0cad090078d 
> 
> Diff: https://reviews.apache.org/r/53803/diff/
> 
> 
> Testing
> ---
> 
> Testing details are at the end of this review chain.
> 
> 
> Thanks,
> 
> Greg Mann
> 
>



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-16 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Nov. 16, 2016, 7:20 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description (updated)
---

This patch adds HTTPTest.SocketEOF to verify that EOFs are
reliably received whether or not there is a pending recv()
request at the time the EOF is received.


Diffs
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
533104c93dd1eaf67bf3752163d2e0cad090078d 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Re: Review Request 53803: Added a new libprocess HTTP test.

2016-11-16 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

(Updated Nov. 16, 2016, 7:20 p.m.)


Review request for mesos, Benjamin Mahler and Joseph Wu.


Changes
---

Rebase.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description (updated)
---

Added a new libprocess HTTP test.


Diffs (updated)
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
533104c93dd1eaf67bf3752163d2e0cad090078d 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann



Review Request 53803: Added a new libprocess HTTP test.

2016-11-15 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53803/
---

Review request for mesos, Benjamin Mahler and Joseph Wu.


Bugs: MESOS-5966
https://issues.apache.org/jira/browse/MESOS-5966


Repository: mesos


Description
---

This patch adds `HTTPTest.SocketEOF` to verify that EOFs are
reliably received whether or not there is a pending `recv()`
request at the time the EOF is received.


Diffs
-

  3rdparty/libprocess/src/tests/http_tests.cpp 
533104c93dd1eaf67bf3752163d2e0cad090078d 

Diff: https://reviews.apache.org/r/53803/diff/


Testing
---

Testing details are at the end of this review chain.


Thanks,

Greg Mann