Skip to content

Conversation

@iwankgb
Copy link
Collaborator

@iwankgb iwankgb commented Apr 10, 2020

Integration tests for Docker container and perf stats.

@iwankgb iwankgb force-pushed the perf_integration_tests branch 4 times, most recently from 8d0b455 to 1fc64df Compare April 14, 2020 17:46
@iwankgb iwankgb force-pushed the perf_integration_tests branch from 9af4e46 to 478f27b Compare April 14, 2020 18:07
@googlebot
Copy link
Collaborator

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@iwankgb iwankgb force-pushed the perf_integration_tests branch from 478f27b to 4dc7481 Compare April 14, 2020 18:08
@googlebot
Copy link
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@iwankgb iwankgb changed the title WIP: Integration test for Docker and perf stats Integration test for Docker and perf stats Apr 14, 2020
@iwankgb
Copy link
Collaborator Author

iwankgb commented Apr 14, 2020

@dashpole, you will find a proposal for extending integration tests in this PR. What changes is that integration tests are being run for "normal" build of cAdvisor (i.e. with no tags) and for a custom one (with libpfm support). I was trying to make each of the test runs independent but it seems to be impossible to use list of objects in build matrix configuration so I decided to settle with shell script based approach.
I have a question about pull-cadvisor-e2e tests: as far as I understand integrations tests are executed using test-integration make target; is this target expected to run on any distribution? To be able to execute perf-related tests I need to install an additional package and it's a distro-specific operation...

CADVISOR_ARGS="$CADVISOR_ARGS" /usr/local/bin/runner.sh build/integration.sh"
}

run_tests "-race" "sudo"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why we want to do perf tests separately? Are they expected to fail in some scenarios?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just read the comment above. I think this is a reasonable solution, although I think we should consider having a separate target. That way users who just want to run the "distro agnostic" tests can do so without having errors mixed in.


assert.Nil(t, err)
assert.Len(t, info.Stats, 1)
assert.Greater(t, len(info.Stats[0].PerfStats), 0, "Length of info.Stats[0].PerfStats is not greater tahn zero")
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/tahn/than

assert.Greater(t, len(info.Stats[0].PerfStats), 0, "Length of info.Stats[0].PerfStats is not greater tahn zero")
for k, stat := range info.Stats[0].PerfStats {
//Everything beyond name is non-deterministic unfortunately.
assert.Contains(t, []string{"context-switches", "cpu-migrations-custom"}, stat.Name, "Wrong metric name for key %d: %#v", k, stat)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we guaranteed to have more than 0 of either of these events? Even that check can sometimes catch problems...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In waitForContainerInfo() we wait for v1.ContainerInfo to be available. Perf stats are part of this structure and I would consider it a bug if they were not available.

@dashpole dashpole self-assigned this Apr 14, 2020
@dashpole
Copy link
Collaborator

cc @dims
in case you want to take a look

@dims
Copy link
Contributor

dims commented Apr 14, 2020

+1 to "perf tests separately" please!

looks reasonable otherwise :)

Maciej "Iwan" Iwanowski added 6 commits April 15, 2020 08:45
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
@iwankgb iwankgb force-pushed the perf_integration_tests branch 2 times, most recently from 4cd5cf6 to 396c32a Compare April 15, 2020 08:31
Maciej "Iwan" Iwanowski added 3 commits April 15, 2020 10:51
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
Signed-off-by: Maciej "Iwan" Iwanowski <[email protected]>
@iwankgb
Copy link
Collaborator Author

iwankgb commented Apr 15, 2020

@dashpole @dims - is such approach acceptable? Changes are:

  • there are shell files that should be sourced before running non-standard integration tests suite
  • same make target is used in both cases
  • paths to the shell files are part of build matrix
  • documentation is provided.

Eventually it would make sense to execute unit tests in Docker too, I think. There are some unit tests against libpfm4 part of code that can be executed without installing the library. What is you opinion?

@dims
Copy link
Contributor

dims commented Apr 15, 2020

@iwankgb works for me!

Copy link
Collaborator

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

lgtm

@dashpole dashpole merged commit ba6fa06 into google:master Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants