Merge lp:~jameinel/gouda/win-fixes into lp:gouda

Proposed by John A Meinel
Status: Needs review
Proposed branch: lp:~jameinel/gouda/win-fixes
Merge into: lp:gouda
Diff against target: 59 lines (+2/-5)
3 files modified
test_serv/gouda_serv.py (+1/-3)
test_serv/service.go (+1/-1)
test_serv/test_gouda_serv.py (+0/-1)
To merge this branch: bzr merge lp:~jameinel/gouda/win-fixes
Reviewer Review Type Date Requested Status
Gouda (Go u1db implementation) hackers Pending
Review via email: mp+132417@code.launchpad.net

Description of the change

Just some simple cleanups I did while testing on Windows.

Nice to have things work in both places, and the changes are general cleanliness improvements anyway. (No reason to leave zombie processes lying around.)

To post a comment you must log in.

Unmerged revisions

28. By John A Meinel

Several fixes on Windows.

Bind to localhost:0, otherwise it binds to all interfaces, which we don't
really want.
Wait() for the child process to exit after sending the shutdown request.
Some small bits of code cleanup.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test_serv/gouda_serv.py'
2--- test_serv/gouda_serv.py 2012-10-30 16:11:48 +0000
3+++ test_serv/gouda_serv.py 2012-10-31 20:28:47 +0000
4@@ -21,7 +21,6 @@
5 import re
6 import subprocess
7 import socket
8-import sys
9 import tempfile
10 from testtools.content import content_from_file
11
12@@ -58,7 +57,6 @@
13 hostname = v4
14 port = int(port)
15 self.child_address = (hostname, port)
16- # sys.stderr.write('Connecting to: %s\n' % (self.child_address,))
17 self.child_conn = socket.create_connection(self.child_address)
18 self.addCleanup(self._shutdown)
19
20@@ -69,7 +67,6 @@
21 request_str = json.dumps(request_dict)
22 self.child_conn.sendall(request_str)
23 response_str = self.child_conn.recv(1024)
24- # sys.stderr.write('Response str: %r\n' % (response_str,))
25 response = json.loads(response_str)
26 assert response['id'] == self.counter
27 if response['error'] is not None:
28@@ -84,6 +81,7 @@
29 def _shutdown(self):
30 self._send_msg('DBService.Shutdown')
31 self.child_conn.close()
32+ self.child.wait()
33
34
35 GoudaTestService = GoudaTestServiceFixture()
36
37=== modified file 'test_serv/service.go'
38--- test_serv/service.go 2012-10-30 16:11:48 +0000
39+++ test_serv/service.go 2012-10-31 20:28:47 +0000
40@@ -34,7 +34,7 @@
41 func NewDBService(conn net.Listener) (*DBService, error) {
42 var err error
43 if conn == nil {
44- conn, err = net.Listen("tcp", ":0")
45+ conn, err = net.Listen("tcp", "localhost:0")
46 if err != nil {
47 return nil, err
48 }
49
50=== modified file 'test_serv/test_gouda_serv.py'
51--- test_serv/test_gouda_serv.py 2012-10-30 16:11:48 +0000
52+++ test_serv/test_gouda_serv.py 2012-10-31 20:28:47 +0000
53@@ -18,7 +18,6 @@
54 import fixtures
55 import json
56 from testtools import TestCase
57-from testtools.content import text_content
58
59 import gouda_serv
60

Subscribers

People subscribed via source and target branches

to all changes: