Skip to content

Refactor TestInspectNetwork#38556

Merged
vdemeester merged 1 commit intomoby:masterfrom
thaJeztah:cleanup_inspect_test
Jan 15, 2019
Merged

Refactor TestInspectNetwork#38556
vdemeester merged 1 commit intomoby:masterfrom
thaJeztah:cleanup_inspect_test

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jan 14, 2019

Clean up and refactor this test;

  • make serviceRunningTasksCount to use a desired-state filter
  • use subtests, and inline the validNetworkVerbose checks; also use
    asserts for the individual checks, so that any failure will log exactly
    what failed
  • don't cleanup services and networks afterwards, as the daemon is only used during this test.
  • remove helper functions that are no longer needed

@thaJeztah
Copy link
Member Author

oh... hmm...

01:25:26     create_test.go:102: timeout hit after 30s: task count at 20 waiting for 4

Wondering what's happening here; other tests are failing.

I have a suspicion what's happening; even though each test spins up a new daemon, the daemon is only stopped afterwards, but not removed (nor their containers/tasks removed).

I wonder if those tasks are still lingering around somewhere (e.g. a new containerd instance picking them up?)

@thaJeztah
Copy link
Member Author

Actually not sure that makes sense; still; looks like something is shared between those daemons, and some state is preserved 🤔

@thaJeztah
Copy link
Member Author

thaJeztah commented Jan 14, 2019

For fun, running these while running the integration tests;

ctr -a /var/run/docker/containerd/containerd.sock -n moby c ls

watch runc --root /var/run/docker/runtime-runc/moby/ list  
Every 2.0s: runc --root /var/run/docker/runtime-runc/moby/ list                                                                                           b0fe40a334ae: Mon Jan 14 02:08:42 2019

ID                                                                 PID         STATUS      BUNDLE
                                CREATED                          OWNER
d5454b990824bd1ffc6308d5ca1727a25dea67a463a6a80000eac430366f52c0   7151        running     /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/d5454b990824bd1ffc6308d5ca1727a25dea67a463a6a80000eac430366f52c0   2019-01-14T01:53:58.101940432Z   root
Every 2.0s: ctr -a /var/run/docker/containerd/containerd.sock -n moby c ls                                                                                      b0fe40a334ae: Mon Jan 14 02:09:20 2019

CONTAINER                                                           IMAGE    RUNTIME
d5454b990824bd1ffc6308d5ca1727a25dea67a463a6a80000eac430366f52c0    -        io.containerd.runtime.v1.linux

@thaJeztah thaJeztah added rebuild/* and removed status/failing-ci Indicates that the PR in its current state fails the test suite labels Jan 14, 2019
@thaJeztah thaJeztah force-pushed the cleanup_inspect_test branch from f81406a to 7b9aeca Compare January 14, 2019 03:12
@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@ebc0750). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #38556   +/-   ##
=========================================
  Coverage          ?   36.64%           
=========================================
  Files             ?      608           
  Lines             ?    45173           
  Branches          ?        0           
=========================================
  Hits              ?    16553           
  Misses            ?    26336           
  Partials          ?     2284

@thaJeztah thaJeztah force-pushed the cleanup_inspect_test branch 2 times, most recently from f9f06c1 to 322a3d5 Compare January 14, 2019 03:15
Clean up and refactor this test;

- make `serviceRunningTasksCount` to use a `desired-state` filter
- use subtests, and inline the `validNetworkVerbose` checks; also use
  asserts for the individual checks, so that any failure will log exactly
  what failed
- remove helper functions that are no longer needed

Signed-off-by: Sebastiaan van Stijn <[email protected]>
}

err = client.ServiceRemove(context.Background(), serviceID2)
// TODO find out why removing networks is needed; other tests fail if the network is not removed, even though they run on a new daemon.
Copy link
Member Author

Choose a reason for hiding this comment

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

I put back the remove step, but added a TODO; we should figure out what is left behind after the daemon is stopped; possibly some network cleanup that's needed on shutdown

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

@vdemeester vdemeester merged commit 60d93aa into moby:master Jan 15, 2019
@thaJeztah thaJeztah deleted the cleanup_inspect_test branch August 12, 2019 23:36
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