feat: tlsping and tcpping using step-by-step (#815)
## Checklist - [x] I have read the [contribution guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md) - [x] reference issue for this pull request: https://github.com/ooni/probe/issues/2158 - [x] if you changed anything related how experiments work and you need to reflect these changes in the ooni/spec repository, please link to the related ooni/spec pull request: https://github.com/ooni/spec/pull/250 ## Description This diff refactors the codebase to reimplement tlsping and tcpping to use the step-by-step measurements style. See docs/design/dd-003-step-by-step.md for more information on the step-by-step measurement style.
This commit is contained in:
parent
5371c7f486
commit
5ebdeb56ca
48 changed files with 2825 additions and 299 deletions
|
|
@ -31,7 +31,7 @@ func TestNewHTTPTransportWithLoggerResolverAndOptionalProxyURL(t *testing.T) {
|
|||
dialer := txpCc.Dialer
|
||||
dialerWithReadTimeout := dialer.(*httpDialerWithReadTimeout)
|
||||
dialerLog := dialerWithReadTimeout.Dialer.(*dialerLogger)
|
||||
dialerReso := dialerLog.Dialer.(*dialerResolver)
|
||||
dialerReso := dialerLog.Dialer.(*dialerResolverWithTracing)
|
||||
if dialerReso.Resolver != resolver {
|
||||
t.Fatal("invalid resolver")
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ func TestNewHTTPTransportWithLoggerResolverAndOptionalProxyURL(t *testing.T) {
|
|||
dialerWithReadTimeout := dialer.(*httpDialerWithReadTimeout)
|
||||
dialerProxy := dialerWithReadTimeout.Dialer.(*proxyDialer)
|
||||
dialerLog := dialerProxy.Dialer.(*dialerLogger)
|
||||
dialerReso := dialerLog.Dialer.(*dialerResolver)
|
||||
dialerReso := dialerLog.Dialer.(*dialerResolverWithTracing)
|
||||
if dialerReso.Resolver != resolver {
|
||||
t.Fatal("invalid resolver")
|
||||
}
|
||||
|
|
@ -269,7 +269,7 @@ func TestNewHTTPTransport(t *testing.T) {
|
|||
t.Run("works as intended with failing dialer", func(t *testing.T) {
|
||||
called := &atomicx.Int64{}
|
||||
expected := errors.New("mocked error")
|
||||
d := &dialerResolver{
|
||||
d := &dialerResolverWithTracing{
|
||||
Dialer: &mocks.Dialer{
|
||||
MockDialContext: func(ctx context.Context,
|
||||
network, address string) (net.Conn, error) {
|
||||
|
|
@ -612,7 +612,7 @@ func TestNewHTTPClientWithResolver(t *testing.T) {
|
|||
txpCc := txpEwrap.HTTPTransport.(*httpTransportConnectionsCloser)
|
||||
dialer := txpCc.Dialer.(*httpDialerWithReadTimeout)
|
||||
dialerLogger := dialer.Dialer.(*dialerLogger)
|
||||
dialerReso := dialerLogger.Dialer.(*dialerResolver)
|
||||
dialerReso := dialerLogger.Dialer.(*dialerResolverWithTracing)
|
||||
if dialerReso.Resolver != reso {
|
||||
t.Fatal("invalid resolver")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue