Mir

Merge lp:~mir-team/mir/more-performance-tests into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Cemil Azizoglu
Approved revision: no longer in the source branch.
Merged at revision: 3325
Proposed branch: lp:~mir-team/mir/more-performance-tests
Merge into: lp:mir
Diff against target: 135 lines (+94/-10)
1 file modified
tests/performance-tests/test_glmark2-es2-mir.cpp (+94/-10)
To merge this branch: bzr merge lp:~mir-team/mir/more-performance-tests
Reviewer Review Type Date Requested Status
Cemil Azizoglu (community) Approve
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Mir CI Bot continuous-integration Approve
Alan Griffiths Needs Information
Review via email: mp+285837@code.launchpad.net

Commit message

Add a bunch more automated performance tests covering more use cases.

I was recently pleased to find that Jenkins had detected a performance
regression in my code. However then I was worried when I realized that
Jenkins should not have failed at all, and it was just by luck of Android
bug 1369763 that CI failed.

So the failure was useful to me, but also should not have happened. Time
to expand the tests to remove the element of luck, so that such performance regressions always cause a failure...

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3312
https://mir-jenkins.ubuntu.com/job/mir-ci/291/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build/79
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/85
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/81
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/81
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=amd64,compiler=gcc,platform=mesa,release=xenial/81
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=amd64,compiler=gcc,platform=mesa,release=xenial/81/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/81
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/81/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/81
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/81/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=i386,compiler=gcc,platform=mesa,release=xenial/81
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-advanced/arch=i386,compiler=gcc,platform=mesa,release=xenial/81/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:3312
http://jenkins.qa.ubuntu.com/job/mir-ci/6277/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-vivid-i386-build/5893
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-clang-vivid-amd64-build/4800
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-vivid-touch/5849
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-xenial-touch/427
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/601
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/601/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/601
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/601/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5846
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5846/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-touch/8242
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27531
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/423
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/423/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-xenial-touch/276
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27533

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/mir-ci/6277/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Was confused about why this was MPed. It makes sense after seeing 'description'.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

+ * FIXME: These all fail because the test server doesn't start more than once:
+ * "std::exception::what: Exception while creating graphics platform
+ * Exiting Mir! Reason: Nested Mir and Host Mir cannot use the same
+ * socket file to accept connections!"

What is this really?

1. We have loads of test cases that start up and close down a server in the acceptance tests. So a server can be run multiple times.

2. That error is about configuring --host and --file to the same (not about starting a server multiple times).

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> + * FIXME: These all fail because the test server doesn't start more than
> once:
> + * "std::exception::what: Exception while creating graphics platform
> + * Exiting Mir! Reason: Nested Mir and Host Mir cannot use the same
> + * socket file to accept connections!"
>
> What is this really?

Oh, that's lp:1290345

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> > + * FIXME: These all fail because the test server doesn't start more than
> > once:
> > + * "std::exception::what: Exception while creating graphics platform
> > + * Exiting Mir! Reason: Nested Mir and Host Mir cannot use the same
> > + * socket file to accept connections!"
> >
> > What is this really?
>
> Oh, that's lp:1290345

Right, I'm MP'd a fix for lp:1290345 - you only need part1 for the problem seen here to be resolved.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Is the name of the output file significant anywhere? IIRC we were collating results somewhere.

review: Needs Information
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Good question. Although if and when we get these multiple results we might want to collate the multiple results from multiple files.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

armhf has issues. No idea what the problem is yet but desktop and valgrind on desktop has no problem. Only armhf:

Error in `mir_performance_tests': free(): invalid pointer: 0xb5f02b08 ***

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

The mir glmark2 performance tests are taking too long by default (5min * N, N is currently 6).

Suggestions:

1. Reduce the amount of time spent in each benchmark scene. This can be achieved with a "-b :duration=2" option (apply duration of 2 seconds to all benchmark scenes)

2. Cherrypick only a few benchmark scenes to run by default. This is again controlled with "-b" command line arguments.

3. Both of the above

review: Needs Fixing
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

> The mir glmark2 performance tests are taking too long by default (5min * N, N
> is currently 6).
>
> Suggestions:
>
> 1. Reduce the amount of time spent in each benchmark scene. This can be
> achieved with a "-b :duration=2" option (apply duration of 2 seconds to all
> benchmark scenes)
>
> 2. Cherrypick only a few benchmark scenes to run by default. This is again
> controlled with "-b" command line arguments.
>
> 3. Both of the above

+1

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Already started on that path :)

34 + char const* selection = getenv("MIR_GLMARK2_TEST_QUICK") ?
35 + "-b build " : "";

Not sure where we will end up as the default behaviour though.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, the tests are now fast and don't crash.

Sadly most of them can't be run on Android due to bugs in our Android driver.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3319
https://mir-jenkins.ubuntu.com/job/mir-ci/336/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/126
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/138
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/134
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/134
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/131
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/131/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/131
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/131/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/131
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/131/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/131
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/131/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:3319
http://jenkins.qa.ubuntu.com/job/mir-ci/6325/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-vivid-i386-build/5971
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-clang-vivid-amd64-build/4878
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-vivid-touch/5927
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-xenial-touch/458
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/649
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/649/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/649
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/649/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5924
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5924/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-touch/8305
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27734
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/454
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/454/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-xenial-touch/307
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27738

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/mir-ci/6325/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

OK as a first step.

review: Approve
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/performance-tests/test_glmark2-es2-mir.cpp'
2--- tests/performance-tests/test_glmark2-es2-mir.cpp 2016-01-29 08:18:22 +0000
3+++ tests/performance-tests/test_glmark2-es2-mir.cpp 2016-02-18 08:39:23 +0000
4@@ -1,3 +1,19 @@
5+/*
6+ * Copyright © 2014-2016 Canonical Ltd.
7+ *
8+ * This program is free software: you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License version 3,
10+ * as published by the Free Software Foundation.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+ */
20+
21 #include "mir_test_framework/async_server_runner.h"
22 #include "mir/test/popen.h"
23
24@@ -27,11 +43,26 @@
25 }
26
27 enum ResultFileType {raw, json};
28- virtual void run_glmark2(char const* output_filename, ResultFileType file_type)
29+ virtual int run_glmark2(char const* args)
30 {
31- auto const cmd = "MIR_SOCKET=" + new_connection() + " glmark2-es2-mir --fullscreen";
32+ ResultFileType file_type = raw; // Should this still be selectable?
33+
34+ auto const cmd = "MIR_SOCKET=" + new_connection()
35+ + " glmark2-es2-mir -b build "
36+ + args;
37 mir::test::Popen p(cmd);
38-
39+
40+ const ::testing::TestInfo* const test_info =
41+ ::testing::UnitTest::GetInstance()->current_test_info();
42+
43+ char output_filename[256];
44+ snprintf(output_filename, sizeof(output_filename) - 1,
45+ "/tmp/%s_%s.log",
46+ test_info->test_case_name(), test_info->name());
47+
48+ printf("Saving GLMark2 detailed results to: %s\n", output_filename);
49+ // ^ Although I would vote to just print them to stdout instead
50+
51 std::string line;
52 std::ofstream glmark2_output;
53 int score = -1;
54@@ -50,9 +81,6 @@
55 }
56 }
57
58- auto const minimum_acceptable_score = 52;
59- EXPECT_THAT(score, ::testing::Ge(minimum_acceptable_score));
60-
61 if (file_type == json)
62 {
63 std::string json = "{";
64@@ -62,11 +90,67 @@
65 json += "}";
66 glmark2_output << json;
67 }
68+
69+ return score;
70 }
71 };
72
73-TEST_F(GLMark2Test, benchmark_fullscreen_default)
74-{
75- run_glmark2("/tmp/glmark2_fullscreen_default.results", raw);
76-}
77+TEST_F(GLMark2Test, fullscreen_default)
78+{
79+ EXPECT_THAT(run_glmark2("--fullscreen"), ::testing::Ge(56));
80+}
81+
82+#ifdef ANDROID
83+TEST_F(GLMark2Test, DISABLED_windowed_default) // Android bug LP: #1546912
84+#else
85+TEST_F(GLMark2Test, windowed_default)
86+#endif
87+{
88+ EXPECT_THAT(run_glmark2(""), ::testing::Ge(56));
89+}
90+
91+#ifdef ANDROID
92+TEST_F(GLMark2Test, DISABLED_fullscreen_interval1) // Android bug LP: #1546912
93+#else
94+TEST_F(GLMark2Test, fullscreen_interval1)
95+#endif
96+{
97+ add_to_environment("MIR_CLIENT_FORCE_SWAP_INTERVAL", "1");
98+ // Our devices seem to range 57-67Hz
99+ EXPECT_NEAR(60, run_glmark2("--fullscreen"), 10);
100+}
101+
102+#ifdef ANDROID
103+TEST_F(GLMark2Test, DISABLED_windowed_interval1) // Android bug LP: #1546912
104+#else
105+TEST_F(GLMark2Test, windowed_interval1)
106+#endif
107+{
108+ add_to_environment("MIR_CLIENT_FORCE_SWAP_INTERVAL", "1");
109+ // Our devices seem to range 57-67Hz
110+ EXPECT_NEAR(60, run_glmark2(""), 10);
111+}
112+
113+#ifdef ANDROID
114+TEST_F(GLMark2Test, DISABLED_fullscreen_interval0) // Android bug LP: #1369763
115+ // and LP: #1546912
116+#else
117+TEST_F(GLMark2Test, fullscreen_interval0)
118+#endif
119+{
120+ add_to_environment("MIR_CLIENT_FORCE_SWAP_INTERVAL", "0");
121+ EXPECT_THAT(run_glmark2("--fullscreen"), ::testing::Ge(100));
122+}
123+
124+#ifdef ANDROID
125+TEST_F(GLMark2Test, DISABLED_windowed_interval0) // Android bug LP: #1369763
126+ // and LP: #1546912
127+#else
128+TEST_F(GLMark2Test, windowed_interval0)
129+#endif
130+{
131+ add_to_environment("MIR_CLIENT_FORCE_SWAP_INTERVAL", "0");
132+ EXPECT_THAT(run_glmark2(""), ::testing::Ge(100));
133+}
134+
135 }

Subscribers

People subscribed via source and target branches