Skip to content

libnetwork: wait until t.Deadline() instead of hardcoded value#42703

Merged
thaJeztah merged 2 commits into
moby:masterfrom
rvolosatovs:fix_network_db_test
Aug 3, 2021
Merged

libnetwork: wait until t.Deadline() instead of hardcoded value#42703
thaJeztah merged 2 commits into
moby:masterfrom
rvolosatovs:fix_network_db_test

Conversation

@rvolosatovs

@rvolosatovs rvolosatovs commented Aug 1, 2021

Copy link
Copy Markdown

(hopefully?) closes #42698

- What I did
It seems that the flakiness is caused by the occasional slowness of the CI, hence wait until t.Deadline for node to appear instead of relying on a hard-coded value, which may or may not suffice in all environments.
Also applied the same "waiting" approach from #42625 in the unit test in question.

- How I did it
Check for t.Deadline and, if set, wait until at most that; use the previous hard-coded value otherwise. Since we set timeout in hack/test/unit, the deadline value should generally be set regardless of the environment, so this should work in CI, as well as locally (unless, of course, tests are run directly with go test).

- How to verify it
I suppose the only way would be to observe multiple CI runs

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Roman Volosatovs added 2 commits August 1, 2021 17:47
Use `verifyNetworkExistence` like it was done in 2837fba

Signed-off-by: Roman Volosatovs <[email protected]>
@rvolosatovs

rvolosatovs commented Aug 1, 2021

Copy link
Copy Markdown
Author

Failures seem unrelated:

[2021-08-01T16:38:04.023Z] === Failed

[2021-08-01T16:38:04.023Z] === FAIL: libnetwork/drivers/bridge TestCreateParallel (0.16s)

[2021-08-01T16:38:04.023Z] time="2021-08-01T16:35:53Z" level=warning msg="bridge store not initialized. kv object docker/network/v1.0/bridge/net76/ is not added to the store"

[2021-08-01T16:38:04.023Z] time="2021-08-01T16:35:53Z" level=warning msg="bridge store not initialized. kv object docker/network/v1.0/bridge/net0/ is not added to the store"

[2021-08-01T16:38:04.023Z]     bridge_test.go:1133: Success should be 1 instead: 2
[2021-08-01T16:38:59.130Z] #59 [rootlesskit 1/3] RUN --mount=type=cache,target=/root/.cache/go-build     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,src=hack/dockerfile/install,target=/tmp/install         PREFIX=/build /tmp/install/install.sh rootlesskit

[2021-08-01T16:38:59.130Z] #59 sha256:18e340e61c658871fde0d759bead78979a9d53e6cb97cfb90918f656225b0873

[2021-08-01T16:44:50.764Z] #59 620.2 error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.

[2021-08-01T16:44:50.764Z] #59 620.2 fatal: the remote end hung up unexpectedly

[2021-08-01T16:44:50.764Z] #59 620.2 fatal: protocol error: bad pack header

[2021-08-01T16:44:50.764Z] #59 ERROR: executor failed running [/bin/sh -c PREFIX=/build /tmp/install/install.sh rootlesskit]: exit code: 128

[2021-08-01T16:44:50.764Z] ------

[2021-08-01T16:44:50.764Z]  > [rootlesskit 1/3] RUN --mount=type=cache,target=/root/.cache/go-build     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,src=hack/dockerfile/install,target=/tmp/install         PREFIX=/build /tmp/install/install.sh rootlesskit:

[2021-08-01T16:44:50.764Z] ------

[2021-08-01T16:44:50.764Z] executor failed running [/bin/sh -c PREFIX=/build /tmp/install/install.sh rootlesskit]: exit code: 128

script returned exit code 1

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
thaJeztah merged commit 7672963 into moby:master Aug 3, 2021
@rvolosatovs
rvolosatovs deleted the fix_network_db_test branch August 3, 2021 13:33
@thaJeztah thaJeztah added this to the 21.xx milestone Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: TestNetworkDBNodeJoinLeaveIteration

3 participants