Mir

Merge lp:~afrantzis/mir/fix-1598802 into lp:mir

Proposed by Alexandros Frantzis on 2016-07-05
Status: Merged
Approved by: Alexandros Frantzis on 2016-07-06
Approved revision: 3576
Merged at revision: 3577
Proposed branch: lp:~afrantzis/mir/fix-1598802
Merge into: lp:mir
Diff against target: 49 lines (+16/-9)
1 file modified
tests/integration-tests/test_test_framework.cpp (+16/-9)
To merge this branch: bzr merge lp:~afrantzis/mir/fix-1598802
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2016-07-06
Kevin DuBois (community) Approve on 2016-07-05
Cemil Azizoglu (community) 2016-07-05 Approve on 2016-07-05
Review via email: mp+299168@code.launchpad.net

Commit message

tests: Fix DemoInProcessServerWithStubClientPlatform.surface_creation_does_not_leak_fds to work reliably with NBS

Description of the change

tests: Fix DemoInProcessServerWithStubClientPlatform.surface_creation_does_not_leak_fds to work reliably with NBS

When using NBS, not all FDs are guaranteed to have been closed
when mir_connection_release() returns, due to the asynchronous nature
of buffer releases. For this reason, in order to avoid false negatives,
we need to allow some time for the FDs to be closed.

To post a comment you must log in.
Cemil Azizoglu (cemil-azizoglu) wrote :

ok

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3576
https://mir-jenkins.ubuntu.com/job/mir-ci/1234/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1431
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1482
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1473
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1473
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1445
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1445/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1445
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1445/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1445
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1445/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1445
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1445/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1445
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1445/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1234/rebuild

review: Approve (continuous-integration)
Kevin DuBois (kdub) wrote :

lgtm

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/379/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1433/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/407/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1485
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1476
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1476
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1447
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1447/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1447/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1447
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1447/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1447
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1447/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1447
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1447/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Alexandros Frantzis (afrantzis) wrote :

Failure in unrelated test, filed as https://bugs.launchpad.net/mir/+bug/1599416

Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/integration-tests/test_test_framework.cpp'
2--- tests/integration-tests/test_test_framework.cpp 2015-06-25 03:00:08 +0000
3+++ tests/integration-tests/test_test_framework.cpp 2016-07-05 14:13:18 +0000
4@@ -21,6 +21,7 @@
5 #include "mir_test_framework/using_stub_client_platform.h"
6 #include "mir_test_framework/any_surface.h"
7 #include "mir/test/signal.h"
8+#include "mir/test/spin_wait.h"
9 #include "mir/test/auto_unblock_thread.h"
10
11 #include "mir_toolkit/mir_client_library.h"
12@@ -78,7 +79,7 @@
13 {
14 mir::test::Signal connection_released;
15
16- int fd_count_after_one_surface_lifetime = 0;
17+ unsigned fd_count_after_one_surface_lifetime = 0;
18
19 mir::test::AutoJoinThread t{
20 [&]
21@@ -106,14 +107,20 @@
22 }};
23
24
25- EXPECT_TRUE(connection_released.wait_for(std::chrono::seconds{480}))
26+ EXPECT_TRUE(connection_released.wait_for(std::chrono::seconds{10}))
27 << "Client hung" << std::endl;
28
29- // Investigation revealed we leak a differing number of fds (3, 0) on Mesa/Android over the
30- // entire lifetime of the client library. So we verify here only that we don't leak any FDs beyond
31- // those created up to the lifetime of the first surface.
32- auto new_fd_count = count_fds();
33-
34- EXPECT_LE(new_fd_count, fd_count_after_one_surface_lifetime);
35-
36+ // Investigation revealed we leak a differing number of fds (3, 0) on
37+ // Mesa/Android over the entire lifetime of the client library. So we
38+ // verify here only that we don't leak any FDs beyond those created up to
39+ // the lifetime of the first surface.
40+ //
41+ // Note that when using NBS, not all FDs are guaranteed to have been closed
42+ // when mir_connection_release() returns, due to the asynchronous nature
43+ // of buffer releases. For this reason, in order to avoid false negatives,
44+ // we need to allow some time for the FDs to be closed.
45+ EXPECT_TRUE(
46+ mir::test::spin_wait_for_condition_or_timeout(
47+ [&] { return count_fds() <= fd_count_after_one_surface_lifetime; },
48+ std::chrono::seconds{3}));
49 }

Subscribers

People subscribed via source and target branches