-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use new geolookup api #1158
base: main
Are you sure you want to change the base?
use new geolookup api #1158
Changes from all commits
4d23783
9c1e2d4
e3eabff
0623fdc
1fc1d5d
ba32b22
a0413df
b0987a3
4c904a4
287ef45
28a6282
b8973b9
ce916a3
6cfac4b
bfd1bda
53bab1c
aa31abf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import ( | |
"errors" | ||
"fmt" | ||
"io" | ||
"io/ioutil" | ||
"net" | ||
"net/http" | ||
"net/url" | ||
|
@@ -96,6 +95,10 @@ func TestProxying(t *testing.T) { | |
newResult, err := Start("testapp", "en_US", testSettings{}, testSession{}) | ||
require.NoError(t, err, "Should have been able to start lantern twice") | ||
require.Equal(t, result.HTTPAddr, newResult.HTTPAddr, "2nd start should have resulted in the same address") | ||
|
||
// give the client time to initialize. This helps with consistency in tests | ||
time.Sleep(1 * time.Second) | ||
|
||
err = testProxiedRequest(helper, result.HTTPAddr, result.DNSGrabAddr, false) | ||
require.NoError(t, err, "Proxying request via HTTP should have worked") | ||
err = testProxiedRequest(helper, result.SOCKS5Addr, result.DNSGrabAddr, true) | ||
|
@@ -162,7 +165,7 @@ func testProxiedRequest(helper *integrationtest.Helper, proxyAddr string, dnsGra | |
|
||
var buf []byte | ||
|
||
buf, err = ioutil.ReadAll(res.Body) | ||
buf, err = io.ReadAll(res.Body) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a sanity check to the length of the body here? Just check Response.ContentLength or whatever it's called, or add a io.LimitReader to some reasonably (large) value? Although I do see a timeout above, if it applies to body reading then it's moot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It think it applies to the entire request, including reading the body. |
||
if err != nil { | ||
return err | ||
} | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something you can expose to synchronize on that will guarantee that it's initialized? Sleeping in tests is always a bad idea and the tests are already super flakey.