Skip to content

Fix TestDaemonProxy integration tests#46122

Merged
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:fix_daemon_integration_test
Aug 1, 2023
Merged

Fix TestDaemonProxy integration tests#46122
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:fix_daemon_integration_test

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Trying to extract the test fixes from #45652, without the OTEL changes, so that we have the ability to backport those to other branches

- Description for the changelog

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

Comment thread integration/daemon/daemon_test.go Outdated
t.Run("reload sanitized", func(t *testing.T) {
t.Parallel()

ctx := context.TODO()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added a single ctx here; this should (deliberately) conflict with the testutil.StartSpan(ctx, t) in #45652, so that we don't forget 😃

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.

Why don't we use context.Background() here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because this one needs to be replaced with the otel one 😂

Either one should be fine I guess

@thaJeztah thaJeztah force-pushed the fix_daemon_integration_test branch from 587507e to 5c15521 Compare July 30, 2023 13:49
@thaJeztah thaJeztah mentioned this pull request Jul 30, 2023
@thaJeztah thaJeztah marked this pull request as ready for review July 30, 2023 15:52
@thaJeztah thaJeztah requested a review from cpuguy83 July 30, 2023 15:52
@thaJeztah
Copy link
Copy Markdown
Member Author

@cpuguy83 PTAL well ... guess you wrote the code, but to check if my "rebase" without OTEL LGTY 😅

Comment thread integration/daemon/daemon_test.go
Comment thread integration/daemon/daemon_test.go
Comment thread testutil/daemon/daemon.go
Allows tests to report their proxy settings for easier troubleshooting
on failures.

Signed-off-by: Brian Goff <[email protected]>
@thaJeztah thaJeztah added this to the 25.0.0 milestone Jul 31, 2023
Comment thread testutil/daemon/daemon.go Outdated
}
}

// PollCheckLogs is a poll.Check that checks the daemon logs for the passed in string (`contains`).
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.

The docs are not right here, there is no “contains” parameter

Comment thread testutil/daemon/daemon.go
scanner := bufio.NewScanner(rdr)
for scanner.Scan() {
if match(scanner.Text()) {
return true, scanner.Text(), nil
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.

Might be nice in a followup to have the context around the scanned text, kinda like grep -C to help debugging a failure

I noticed this was always being skipped because of race conditions
checking the logs.

This change adds a log scanner which will look through the logs line by
line rather than allocating a big buffer.
Additionally it adds a `poll.Check` which we can use to actually wait
for the desired log entry.

Signed-off-by: Brian Goff <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also fixes up some cleanup issues.

Signed-off-by: Brian Goff <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the fix_daemon_integration_test branch from 2586414 to 1a51898 Compare July 31, 2023 22:14
@thaJeztah
Copy link
Copy Markdown
Member Author

There was a test that failed earlier; TestDockerAPISuite/TestExecResizeAPIHeightWidthNoInt, which made the TestDockerAPISuite fail (but there's an (unknown), not sure what that is, haven't checked):

=== RUN   TestDockerAPISuite/TestExecResizeAPIHeightWidthNoInt
    docker_api_exec_resize_test.go:20: unmatched requirement DaemonIsLinux
--- SKIP: TestDockerAPISuite/TestExecResizeAPIHeightWidthNoInt (0.00s)
=== RUN   TestDockerAPISuite/TestExecResizeImmediatelyAfterExecStart
ERROR failed to interrupt 'go test': not supported by windows
FAIL	github.com/docker/docker/integration-cli	6762.975s

...


=== Failed
=== FAIL: github.com/docker/docker/integration-cli TestDockerAPISuite/TestExecResizeImmediatelyAfterExecStart (unknown)

=== FAIL: github.com/docker/docker/integration-cli TestDockerAPISuite (unknown)

But CI kept running, until it timed out;

DONE 135 tests, 48 skipped, 2 failures in 6897.321s
INFO: make.ps1 ended at 08/01/2023 00:22:51
Error: The operation was canceled.

Aaaaaand.... I just now realized the reason for that was starting me right in the face, and is in the logs;

ERROR failed to interrupt 'go test': not supported by windows

LOL, so I wonder what part of our CI that is, and if we need to use some other way to make the Windows CI stop on a failure.

@thaJeztah
Copy link
Copy Markdown
Member Author

Either way, CI is green now, so bringing this one in

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.

3 participants