[go: up one dir, main page]

File: internal.xml

package info (click to toggle)
libdb-je-java 3.3.62-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 12,832 kB
  • ctags: 18,708
  • sloc: java: 149,906; xml: 1,980; makefile: 14; sh: 12
file content (418 lines) | stat: -rw-r--r-- 16,577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<?xml version="1.0"?>

<!-- =================================================== -->
<!-- Internal build targets for Berkeley DB Java Edition -->
<!-- All targets here are for internal use only and are  -->
<!-- not part of the published package.                  -->
<!-- =================================================== -->

<project name="JEInternal" default="jar" basedir="..">
<description>Internal targets for JE</description>

    <!--
    Properties that are intended to be passed via -D on the command line.
    -->
    <!-- Arguments to be passed on the command line of the <java> task. -->
    <property name="args" value=""/>
    <!-- Default jar file for testing is the je.jar built here. -->
    <property name="testjar" value="${jarfile}"/>

    <!--
    Common standalone test properties.
    -->
    <property name="standalone.srcdir" location="${basedir}/test/standalone"/>
    <property name="standalone.dir" location="${builddir}/test/standalone"/>
    <property name="standalone.destdir" location="${standalone.dir}/classes"/>
    <property name="standalone.datadir" location="${standalone.dir}/data"/>
    <property name="standalone.logfile" location="${standalone.dir}/log"/>
    <property name="standalone.propfile"
              location="${standalone.datadir}/je.properties"/>

    <path id="standalone.compile.classpath">
      <pathelement location="${destdir}"/>
      <pathelement location="${standalone.destdir}"/>
      <path refid="clover.classpath"/>
    </path>

    <path id="standalone.test.classpath">
      <pathelement location="${testjar}"/>
      <pathelement location="${standalone.destdir}"/>
      <path refid="clover.classpath"/>
    </path>

    <!-- ============================================================ -->
    <!-- Global Targets                                               -->
    <!-- ============================================================ -->

    <target name="init">
        <mkdir dir="${standalone.dir}"/>
        <mkdir dir="${standalone.destdir}"/>
    </target>

    <target name="clean" depends="clean-standalone"/>

    <target name="compile" depends="compile-standalone"/>

    <target name="init-standalone" depends="init">
        <delete dir="${standalone.datadir}"/>
        <mkdir dir="${standalone.datadir}"/>
    </target>

    <target name="clean-standalone" depends="init">
        <delete dir="${standalone.destdir}"/>
        <mkdir dir="${standalone.destdir}"/>
    </target>

    <target name="compile-standalone" depends="init-standalone">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <property name="srcdir" value="${standalone.srcdir}"/>
            <property name="destdir" value="${standalone.destdir}"/>
            <property name="include" value="**/*.java"/>
            <reference refid="standalone.compile.classpath"
	               torefid="compile.classpath"/>
        </ant>
    </target>


    <!-- Outputs the version of the ${jvm} so it can be visually verified. -->
    <target name="javaversion">
      <java classname="xxNotUsed" fork="yes" jvm="${jvm}">
        <jvmarg value="-version"/>
      </java>
    </target>

    <!-- =================== Standalone regression tests ======================
    Tests that have a standard Java main and are run separately via <java>
    rather than via <junit>.

    Specific test targets (e.g., MemoryStress) are also invoked via the
    'standalone' target in build.xml, using -Dtestcase=TestName where TestName
    is the name of the one of the targets below.  Additional program args and
    JVM args can be specified using -Dargs= and -Djvmargs=.
    
    Each test program should:
     + fail (System.exit with non-zero value) if the test fails
     + write log information and errors to System.out and System.err
     + take command line arguments for environment home and other parameters 
     + allow command line arguments to be repeated, so that the last specified
       argument takes precendence; this allows specifying -Dargs="..." to
       override arguments specified explicitly in the <java> task
     + Print the full command line at the start of the test
     + Check for data correctness, as well as for exceptions; if a
       correctness check fails, the test should fail
     + As part of correctness checking, check statistics to ensure that
       activities relevant to the test are occurring (cache misses,
       eviction, cleaning, etc)

    Each test target below should:
     + run the <java> task to invoke the standalone test program
     + use fork="yes" 
     + use failonerror="yes"
     + use output="${standalone.logfile}"
     + use the predefined standalone.test.classpath
     + pass ${standalone.datadir} as the environment directory argument
     + pass other program args using <arg>, followed by <arg line="${args}"/>
       to allow overriding program args using -Dargs="..."
     + pass JVM args using <jvmarg>, followed by <jvmarg line="${jvmargs}"/>
       to allow overriding JVM args using -Djvmargs="..."
     + for stress tests, use <jvmarg value="-ea"/> to enable assertions

    Each test may have any number of properties that can be passed via
    -Dargs="...".  However, a default regression test should run without
    specifying any such properties.

    Some tests (namely performance regressions such as BigRandom) are not meant
    to fail or pass in an automated way, and instead they output data that must
    be manually examined.

    By default a test is run against the je.jar built here.  -Dtestjar=JARFILE
    may be used to run the test againt a different release of JE, as long as
    the test only uses JE APIs that exist in that release, of course.  For
    example, this can be used to run BigRandom against an earlier released
    version of JE.

    Miscellaneous:
     + For long-running test, you can specify
       "-Djvmargs=-Xloggc:<file>, -XX:-PrintGCTimeStamps, -XX:-PrintGCDetails"
       to monitor GC behaviors. This would be useful for performance tests.
     + In case of performance tuning standalone tests, it would be helpful to
       print a full list of JE's perf tuning parameters(e.g. je.maxMemory,
       je.cleaner.threads, etc) to logs and then do the comparisons.
    ======================================================================= -->
    <target name="standalone" depends="javaversion">
      <echo message="Running: ${testcase}"/>
      <echo message="Using JE: ${testjar}"/>
      <echo message="Overriding: args=${args} jvmargs=${jvmargs}"/>
      <echo message="See results in: (${standalone.logfile})"/>
      <antcall target="${testcase}" inheritrefs="true"/>
    </target>

    <!--
    MemoryStress: Runs a stress test under low memory conditions to force an
    OutOfMemoryError to occur if a memory cache budget bug exists.  Also
    outputs a detailed log.
    
    Regression test:  Test should pass when run as follows:

      ant -Dtestcase=MemoryStress standalone
      ant -Dtestcase=MemoryStress -Dargs="-dups" standalone
    -->
    <target name="MemoryStress">
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="MemoryStress"
            output="${standalone.logfile}">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-Xmx42m"/>
	<jvmarg value="-ea"/>
	<jvmarg value="-DsetErrorListener=true"/>
	<jvmarg line="${jvmargs}"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-nThreads"/>
        <arg value="20"/>
        <arg value="-nOps"/>
        <arg value="500000"/>
        <arg line="${args}"/>
      </java>
    </target>

    <!--
    EnvSharedCache: Runs a stress test comparing EnvironmentStats with/without
    setting EnvironmentConfig.setSharedCache(true) to see if the shared env
    cache works efficiently.  Also outputs a detailed log.
    
    Regression test:  Test should pass when run as follows:

      ant -Dtestcase=EnvSharedCache standalone
      ant -Dtestcase=EnvSharedCache -Dargs="-opentest" standalone
      ant -Dtestcase=EnvSharedCache -Dargs="-eventest" standalone
    -->
    <target name="EnvSharedCache">
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="EnvSharedCache"
            output="${standalone.logfile}">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-Xmx128m"/>
	<jvmarg value="-ea"/>
	<jvmarg value="-DsetErrorListener=true"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-v"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-envs"/>
        <arg value="4"/>
        <arg value="-threads"/>
        <arg value="4"/>
        <arg value="-keys"/>
        <arg value="25000"/>
        <arg value="-initonly"/>
      </java>
      <!-- If it's opentest, use larger number of txns for a 12hour run. -->
      <condition property="num.txns" value="600000">
        <contains string="${args}" substring="-opentest"/>
      </condition>
      <condition property="num.txns" value="25000">
        <not>
          <isset property="num.txns"/>
        </not>
      </condition>
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="EnvSharedCache"
            output="${standalone.logfile}" append="true">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-Xmx128m"/>
	<jvmarg value="-ea"/>
	<jvmarg value="-DsetErrorListener=true"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-v"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-envs"/>
        <arg value="4"/>
        <arg value="-threads"/>
        <arg value="4"/>
        <arg value="-txns"/>
        <arg value="${num.txns}"/>
        <arg value="-cachetest"/>
        <arg value="-shared"/>
        <arg line="${args}"/>
      </java>
    </target>

    <!--
    BigRandom: Outputs a detailed log and final throughput value.
    
    Regression test:  The final throughput (printed as the last line of the
    log) should be roughly equal or greater than for the prior release.  The
    test is normally run twice as follows, for each version of JE being tested;
    four times in all.  Each run takes apprx 12 to 24 hours.

      ant -Dtestcase=BigRandom standalone
      ant -Dtestcase=BigRandom -Dargs="-nosync" standalone

    After each test is run, be sure to save the log file for comparing it to
    subsequent runs and for generating graphs later.  For example:

      cp build/test/standalone/log bigrandom-je3.2.23-nosync-log

    Not yet done:
    + move maxMemory to a command line argument so it can be overridden using
      the args property.
    + automate running of gnuplot to produce graphs for comparing
      multiple runs.
    -->
    <target name="BigRandom">
      <echo message="je.maxMemory=268435456"
            file="${standalone.propfile}"/>
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="BigRandom"
            output="${standalone.logfile}">
        <classpath refid="standalone.test.classpath"/>
	<jvmarg value="-Xmx360m"/>
	<jvmarg value="-DsetErrorListener=true"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-initonly"/>
        <arg value="-locality"/>
        <arg value="5"/>
        <arg value="-keys"/>
        <arg value="10000000"/>
        <arg line="${args}"/>
      </java>
      <echo message="result ${test.result}"/>
    </target>

    <!--
    RemoveDbStress: Make sure no bugs are spotted when remove/truncate
    database is being called and the log cleaner and checkpointer threads
    are interacting with the db. Also outputs a detailed log and final
    throughput value.
    
    Regression test:  The final throughput (printed as the last line of the
    log) should be roughly equal or greater than for the prior release.  The
    test is normally run once as follows when needed.
    Each run takes apprx 1 to 2 hours.

      ant -Dtestcase=RemoveDbStress standalone

    After each test is run, the log file is automatically copied to
    RemoveDbStress-<yyMMdd_HH>-log for comparing it to subsequent runs.

    -->
    <target name="RemoveDbStress">
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="RemoveDbStress"
            output="${standalone.logfile}">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-ea"/>
        <jvmarg value="-DsetErrorListener=true"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-iter"/>
        <arg value="200000"/>
        <arg line="${args}"/>
      </java>
      <tstamp>
        <format property="log.time" pattern="yyMMdd_HH"/>
      </tstamp>
      <copy file="${standalone.logfile}"
            tofile="${standalone.dir}/RemoveDbStress-${log.time}-log"/>
    </target>

    <!--
    BigDW: Runs a stress test to check if deferred writed database works as
    properly as a normal one by performing insertion, dup-deletion and read
    operations against a normal database and a deferred writed database. The
    outputed throughput (printed as the last line of the log) should be around
    30 ops/sec, and 20000 txns should be enough for apprx 10 mins run.

    Regression test:  Test should pass when run as follows:

      ant -Dtestcase=BigDW standalone
      ant -Dtestcase=BigDW -Dargs="-txns 100000" standalone
    
    After each test is run, the log file is automatically copied to
    BigDW-<yyMMdd_HH>-log for comparing it to subsequent runs.
    -->
    <target name="BigDW">
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="BigDW"
            output="${standalone.logfile}">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-Xmx32m"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-v"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-init"/>
        <arg value="-dupdel"/>
        <arg line="${args}"/>
      </java>
      <tstamp>
        <format property="log.time" pattern="yyMMdd_HH"/>
      </tstamp>
      <copy file="${standalone.logfile}"
            tofile="${standalone.dir}/BigDW-${log.time}-log"/>
    </target>

    <!--
    ClosedDbEviction: Runs a stress test to test the efficiency of eviction of
    closed database roots, to make sure that the eviction would not
    cause corruption or concurrency bugs. Also prints a detailed log.

    Regression test:  Test should pass when run as follows:

      ant -Dtestcase=ClosedDbEviction standalone
      ant -Dtestcase=ClosedDbEviction -Dargs="-recovery 10000000" standalone

    After each test is run, the log file is automatically copied to
    ClosedDbEviction-<yyMMdd_HH>-log for comparing it to subsequent runs.
    -->
    <target name="ClosedDbEviction">
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="ClosedDbEviction"
            output="${standalone.logfile}">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-Xmx512m"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-v"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-init"/>
        <arg value="100000"/>
      </java>
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="ClosedDbEviction"
            output="${standalone.logfile}" append="true">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-Xmx32m"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-v"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-contention"/>
        <arg value="100000000"/>
        <arg line="${args}"/>
      </java>
      <java fork="yes" jvm="${jvm}" failonerror="yes"
            classname="ClosedDbEviction"
            output="${standalone.logfile}" append="true">
        <classpath refid="standalone.test.classpath"/>
        <jvmarg value="-Xmx32m"/>
        <jvmarg line="${jvmargs}"/>
        <arg value="-v"/>
        <arg value="-h"/>
        <arg value="${standalone.datadir}"/>
        <arg value="-evict"/>
        <arg value="20000000"/>
        <arg line="${args}"/>
      </java>
      <tstamp>
        <format property="log.time" pattern="yyMMdd_HH"/>
      </tstamp>
      <copy file="${standalone.logfile}"
            tofile="${standalone.dir}/ClosedDbEviction-${log.time}-log"/>
    </target>
</project>