~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to jstests/slowNightly/dur_passthrough.js

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// runs the toplevel jstests with --dur
2
 
//
3
 
// TODO(mathias) use paranoid mode (--durOptions 8) once we are reasonably sure it will pass
4
 
 
5
 
// DEBUG : set this variable to debug by skipping to a specific test to start with and go from there
6
 
//var skippingTo = /null.js/;
7
 
var skippingTo = false;
8
 
 
9
 
print("dur_passthrough.js starting mongod");
10
 
conn = startMongodEmpty("--port", 30100, "--dbpath", "/data/db/dur_passthrough", "--dur", "--smallfiles");
11
 
db = conn.getDB("test");
12
 
print("dur_passthrough.js 0");
13
 
 
14
 
var lastRan = null;
15
 
 
16
 
function durPassThrough() {
17
 
 
18
 
    var runnerStart = new Date()
19
 
 
20
 
    var ran = {};
21
 
 
22
 
    /** run a test. won't run more than once. logs if fails and then throws.
23
 
    */
24
 
    function runTest(x) {
25
 
        function _run(x) {
26
 
            if (/[\/\\]_/.test(x.name) ||
27
 
                    !/\.js$/.test(x.name) ||
28
 
                    /repair/.test(x.name) ||
29
 
                    //          /numberlong/.test(x.name) ||
30
 
                    false // placeholder so all real tests end in ||
31
 
                ) 
32
 
            {
33
 
                print("dur_passthrough.js >>>> skipping test " + x.name);
34
 
                return;
35
 
            }
36
 
            print();
37
 
            print("dur_passthrough.js run " + x.name);
38
 
            print("dur_passthrough.js end " + x.name + ' ' + Date.timeFunc(function () { load(x.name); }, 1) + "ms");
39
 
            print();
40
 
        }
41
 
        if (ran[x.name])
42
 
            return;
43
 
        ran[x.name] = true;
44
 
        printjson(x);
45
 
        try {
46
 
            lastRan = x;
47
 
            _run(x);
48
 
        }
49
 
        catch (e) {
50
 
            print("\n\n\n\ndur_passthrough.js FAIL");
51
 
            print("dur_passthrough.js failed test : " + x.name + "\n\n\n");
52
 
            throw e;
53
 
        }
54
 
        print("after run");
55
 
    }
56
 
 
57
 
    print("dur_passthrough.js 1");
58
 
    var files = listFiles("jstests");
59
 
    print("dur_passthrough.js 2");
60
 
 
61
 
    if( !skippingTo ) {
62
 
            // run something that will almost surely pass and is fast just to make sure our framework 
63
 
            // here is really working
64
 
 
65
 
            runTest({ name: 'jstests/basic1.js' });
66
 
 
67
 
            runTest({ name: 'jstests/update.js' });
68
 
 
69
 
            // run "suspicious" tests early.  these are tests that have ever failed in buildbot.  we run them 
70
 
            // early and try to get a fail fast
71
 
            runTest({ name: 'jstests/shellstartparallel.js' });
72
 
            runTest({ name: 'jstests/cursora.js' });
73
 
 
74
 
            // run the shell-oriented tests early. if the shell is broken the other tests aren't meaningful
75
 
            runTest({ name: 'jstests/run_program1.js' });
76
 
            runTest({ name: 'jstests/shellspawn.js' });
77
 
            runTest({ name: 'jstests/shellkillop.js' });
78
 
    }
79
 
 
80
 
    print("dur_passthrough.js 3");
81
 
 
82
 
    files = files.sort(compareOn('name'));
83
 
 
84
 
    print("dur_passthrough.js 4");
85
 
 
86
 
    files.forEach(
87
 
        function (x) {
88
 
            if (skippingTo && !skippingTo.test(x.name)) {
89
 
                print("dur_passthrough.js temp skip " + x.name);
90
 
                return;
91
 
            }
92
 
            skippingTo = false;
93
 
 
94
 
            // to keep memory usage low on 32 bit:
95
 
            try {
96
 
                db.adminCommand("closeAllDatabases");
97
 
            }
98
 
            catch(e) { 
99
 
                print("dur_passthrough.js ERROR exception calling closeAllDatabases between tests : " + e);
100
 
                throw(e);
101
 
            }
102
 
            runTest(x);
103
 
        }
104
 
    );
105
 
 
106
 
    print("dur_passthrough.js ending, calling stopMongod");
107
 
    stopMongod(30100);
108
 
    var runnerEnd = new Date();
109
 
    print("dur_passthrough.js total runner time: " + ((runnerEnd.getTime() - runnerStart.getTime()) / 1000) + "secs")
110
 
}
111
 
 
112
 
try {
113
 
    durPassThrough();
114
 
}
115
 
catch(e) { 
116
 
    print("\n\n\ndur_passthrough.js error, exception in dur_passthrough.js : " + e);
117
 
    print("dur_passthrough.js FAIL");
118
 
    print("dur_passthrough.js lastRan :");
119
 
    printjson(lastRan);
120
 
    print("\n\n\n");
121
 
    throw e;
122
 
}
123
 
 
124
 
print("\n\n\ndur_passthrough.js SUCCESS\n\n\n");