Skip to content

Commit

Permalink
set waittime on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Oct 25, 2024
1 parent 86e11cc commit eda8ab2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ func (fctx *FrontingContext) ConfigureWithHello(pool *x509.CertPool, providers m
existing.closeCache()
}

f, err := newFronted(pool, providers, defaultProviderID, cacheFile, clientHelloID, func(f *fronted) {

_, err := newFronted(pool, providers, defaultProviderID, cacheFile, clientHelloID, func(f *fronted) {
fctx.instance.Set(f)
})
if err != nil {
return err
}
fctx.instance.Set(f)
return nil
}

Expand Down
12 changes: 6 additions & 6 deletions fronted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestDirectDomainFrontingWithSNIConfig(t *testing.T) {
})
Configure(certs, p, testProviderID, cacheFile)

transport, ok := NewFronted(0)
transport, ok := NewFronted(30 * time.Second)
require.True(t, ok)
client := &http.Client{
Transport: transport,
Expand Down Expand Up @@ -94,7 +94,7 @@ func doTestDomainFronting(t *testing.T, cacheFile string, expectedMasqueradesAtE
}
require.True(t, doCheck(client, http.MethodPost, http.StatusAccepted, pingURL))

transport, ok = NewFronted(0)
transport, ok = NewFronted(30 * time.Second)
require.True(t, ok)
client = &http.Client{
Transport: transport,
Expand Down Expand Up @@ -238,7 +238,7 @@ func TestHostAliasesBasic(t *testing.T) {
certs.AddCert(cloudSack.Certificate())
Configure(certs, map[string]*Provider{"cloudsack": p}, "cloudsack", "")

rt, ok := NewFronted(10 * time.Second)
rt, ok := NewFronted(30 * time.Second)
if !assert.True(t, ok, "failed to obtain direct roundtripper") {
return
}
Expand Down Expand Up @@ -349,7 +349,7 @@ func TestHostAliasesMulti(t *testing.T) {
}

Configure(certs, providers, "cloudsack", "")
rt, ok := NewFronted(10 * time.Second)
rt, ok := NewFronted(30 * time.Second)
if !assert.True(t, ok, "failed to obtain direct roundtripper") {
return
}
Expand Down Expand Up @@ -475,7 +475,7 @@ func TestPassthrough(t *testing.T) {
certs.AddCert(cloudSack.Certificate())
Configure(certs, map[string]*Provider{"cloudsack": p}, "cloudsack", "")

rt, ok := NewFronted(10 * time.Second)
rt, ok := NewFronted(30 * time.Second)
if !assert.True(t, ok, "failed to obtain direct roundtripper") {
return
}
Expand Down Expand Up @@ -615,7 +615,7 @@ func TestCustomValidators(t *testing.T) {

for _, test := range tests {
setup(test.validator)
direct, ok := NewFronted(1 * time.Second)
direct, ok := NewFronted(30 * time.Second)
if !assert.True(t, ok) {
return
}
Expand Down

0 comments on commit eda8ab2

Please sign in to comment.