Merge lp:~pbeaman/akiban-persistit/fix_nightly_stress_tests2 into lp:akiban-persistit

Proposed by Peter Beaman
Status: Merged
Approved by: Nathan Williams
Approved revision: 324
Merged at revision: 324
Proposed branch: lp:~pbeaman/akiban-persistit/fix_nightly_stress_tests2
Merge into: lp:akiban-persistit
Diff against target: 55 lines (+10/-6)
2 files modified
src/test/java/com/persistit/StressRunner.java (+0/-1)
src/test/java/com/persistit/stress/AbstractSuite.java (+10/-5)
To merge this branch: bzr merge lp:~pbeaman/akiban-persistit/fix_nightly_stress_tests2
Reviewer Review Type Date Requested Status
Nathan Williams Approve
Review via email: mp+110619@code.launchpad.net

Description of the change

Very minor tweaks to (a) reinstate save-on-failure behavior, (b) properly record failure status even AbstractSuite#execute is called repeatedly (as it is in Stress10Suite), (c) drop the trailing '/' or '\' (Windows?) from the datapath argument as a convenience since it causes tests to fail but is generated by auto-complete.

To post a comment you must log in.
Revision history for this message
Nathan Williams (nwilliams) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/test/java/com/persistit/StressRunner.java'
2--- src/test/java/com/persistit/StressRunner.java 2012-06-14 20:25:59 +0000
3+++ src/test/java/com/persistit/StressRunner.java 2012-06-15 20:49:21 +0000
4@@ -66,7 +66,6 @@
5
6 private final static String[] ARGS_TEMPLATE = {
7 "duration|int::10|Maximum duration in seconds",
8- "_flag|S|Save on failure",
9 "report|String:StressRunner_" + String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", System.currentTimeMillis()),
10 "tests|String:*|List of comma-separated patterns" };
11
12
13=== modified file 'src/test/java/com/persistit/stress/AbstractSuite.java'
14--- src/test/java/com/persistit/stress/AbstractSuite.java 2012-06-14 20:15:48 +0000
15+++ src/test/java/com/persistit/stress/AbstractSuite.java 2012-06-15 20:49:21 +0000
16@@ -72,7 +72,11 @@
17 protected AbstractSuite(final String name, final String[] args) {
18 _name = name;
19 final ArgParser ap = new ArgParser(getClass().getSimpleName(), args, ARGS_TEMPLATE);
20- _logPath = _dataPath = ap.getStringValue("datapath");
21+ String dataPath = ap.getStringValue("datapath");
22+ if (dataPath.endsWith("/") || dataPath.endsWith("\\")) {
23+ dataPath = dataPath.substring(0, dataPath.length() - 1);
24+ }
25+ _logPath = _dataPath = dataPath;
26 _duration = ap.getLongValue("duration");
27 _progressLogInterval = ap.getLongValue("progress");
28 _untilStopped = ap.isSpecified("duration");
29@@ -159,21 +163,22 @@
30 thread.join(MS_PER_S);
31 }
32
33- _failed = false;
34+ boolean failed = false;
35 long work = 0;
36 for (AbstractStressTest test : _tests) {
37 if (test.isFailed()) {
38- _failed = true;
39+ failed = true;
40 }
41 work += test.getTotalWorkDone();
42 }
43 _elapsed = (System.nanoTime() - start) / NS_PER_S;
44- System.out.printf("\n---Result %s: %s work=%,d time=%,d rate=%,d ---\n", this._name, _failed ? "FAILED"
45+ System.out.printf("\n---Result %s: %s work=%,d time=%,d rate=%,d ---\n", this._name, failed ? "FAILED"
46 : "PASSED", work, _elapsed, _elapsed > 0 ? work / _elapsed : 0);
47
48- if (_failed && _saveOnFailure) {
49+ if (failed && _saveOnFailure) {
50 saveOnFailure();
51 }
52+ _failed |= failed;
53 } catch (Exception e) {
54 throw new RuntimeException(e);
55 }

Subscribers

People subscribed via source and target branches