Skip to content

Commit 6ab17a2

Browse files
committed
validation
Signed-off-by: Piotr Janik <piotr.janik@sap.com>
1 parent 26f3bf2 commit 6ab17a2

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

api/oci/extensions/repositories/ocireg/timeout_integration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ var _ = Describe("Registry timeout:", Ordered, func() {
5151

5252
var err error
5353
nw, err = network.New(ctx)
54-
Expect(err).To(Succeed(), "failed to create Docker network")
54+
Expect(err).ToNot(HaveOccurred(), "failed to create Docker network")
5555

5656
registryContainer, err = registry.Run(ctx, registryImage,
5757
network.WithNetwork([]string{"registry"}, nw),
5858
testcontainers.WithWaitStrategy(wait.ForHTTP("/v2/").WithPort("5000/tcp")),
5959
)
60-
Expect(err).To(Succeed(), "failed to start registry container")
60+
Expect(err).ToNot(HaveOccurred(), "failed to start registry container")
6161

6262
toxiContainer, err = tctoxiproxy.Run(ctx, toxiproxyImage,
6363
network.WithNetwork([]string{"toxiproxy"}, nw),
6464
tctoxiproxy.WithProxy(proxyName, fmt.Sprintf("registry:%d", registryPort)),
6565
)
66-
Expect(err).To(Succeed(), "failed to start toxiproxy container")
66+
Expect(err).ToNot(HaveOccurred(), "failed to start toxiproxy container")
6767

6868
host, port, err := toxiContainer.ProxiedEndpoint(8666)
6969
Expect(err).ToNot(HaveOccurred())
@@ -73,7 +73,7 @@ var _ = Describe("Registry timeout:", Ordered, func() {
7373
Expect(err).ToNot(HaveOccurred())
7474
toxiClient := toxiproxy.NewClient(uri)
7575
proxy, err = toxiClient.Proxy(proxyName)
76-
Expect(err).To(Succeed(), "failed to get toxiproxy proxy")
76+
Expect(err).ToNot(HaveOccurred(), "failed to get toxiproxy proxy")
7777

7878
env = NewTestEnv(envhelper.FileSystem(osfs.New()))
7979

api/utils/httpclient/transport_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ var _ = Describe("NewTransport", func() {
8787
Expect(tr.DialContext).NotTo(BeNil())
8888
Expect(tr.TLSHandshakeTimeout).To(Equal(defaultTransport.TLSHandshakeTimeout))
8989
})
90+
91+
It("replaces DialContext when negative TCPKeepAlive disables probes", func() {
92+
tr, err := httpclient.NewTransport(&ocicpi.HTTPSettings{
93+
TCPKeepAlive: dur("-1s"),
94+
})
95+
Expect(err).To(Succeed())
96+
Expect(tr.DialContext).NotTo(BeNil())
97+
})
9098
})
9199

92100
Context("when all fields are set", func() {

0 commit comments

Comments
 (0)