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
|
This are temporary work-arounds for spurious test failures. See the discussions at
http://forums.oracle.com/forums/thread.jspa?threadID=431242
http://forums.oracle.com/forums/thread.jspa?threadID=431549
http://forums.oracle.com/forums/thread.jspa?threadID=446837
The last one appears somewhat scary, but SleepyCat/Oracle's support assures me, the problem
can be ignored as it has to do with the test framework and not the software itself.
-mi
--- test/com/sleepycat/je/recovery/CheckpointActivationTest.java Tue Sep 12 15:17:22 2006
+++ test/com/sleepycat/je/recovery/CheckpointActivationTest.java Fri Oct 6 23:42:55 2006
@@ -51,5 +51,5 @@
* checkpoints ran.
*/
- public void testLogSizeBasedCheckpoints()
+ public void meowLogSizeBasedCheckpoints()
throws Exception {
--- test/com/sleepycat/je/test/DeferredWriteTest.java Tue Sep 12 15:17:24 2006
+++ test/com/sleepycat/je/test/DeferredWriteTest.java Tue Oct 10 17:22:34 2006
@@ -524,5 +524,5 @@
}
- public void testCleaning5000()
+ public void meowCleaning5000()
throws Throwable {
@@ -530,5 +530,5 @@
}
- public void testCleaning2000()
+ public void meowCleaning2000()
throws Throwable {
Index: test/com/sleepycat/je/cleaner/ReadOnlyLockingTest.java
===================================================================
diff -c -r1.7 ReadOnlyLockingTest.java
*** test/com/sleepycat/je/cleaner/ReadOnlyLockingTest.java 12 Sep 2006 19:17:14 -0000 1.7
--- test/com/sleepycat/je/cleaner/ReadOnlyLockingTest.java 23 Nov 2006 00:07:40 -0000
***************
*** 36,41 ****
--- 35,41 ----
public class ReadOnlyLockingTest extends TestCase {
private static final int FILE_SIZE = 4096;
+ private static final int READER_STARTUP_SECS = 30;
private static final CheckpointConfig forceConfig = new CheckpointConfig();
static {
***************
*** 48,53 ****
--- 48,72 ----
private Database db;
private Process readerProcess;
+ private static File getProcessFile() {
+ return new File(System.getProperty(TestUtils.DEST_DIR),
+ "ReadOnlyProcessFile");
+ }
+
+ private static void deleteProcessFile() {
+ File file = getProcessFile();
+ file.delete();
+ TestCase.assertTrue(!file.exists());
+ }
+
+ static void createProcessFile()
+ throws IOException {
+
+ File file = getProcessFile();
+ TestCase.assertTrue(file.createNewFile());
+ TestCase.assertTrue(file.exists());
+ }
+
public ReadOnlyLockingTest() {
envHome = new File(System.getProperty(TestUtils.DEST_DIR));
}
***************
*** 55,60 ****
--- 74,81 ----
public void setUp()
throws IOException, DatabaseException {
+ deleteProcessFile();
+
TestUtils.removeLogFiles("Setup", envHome, false);
TestUtils.removeFiles("Setup", envHome, FileManager.DEL_SUFFIX);
}
***************
*** 62,67 ****
--- 83,90 ----
public void tearDown()
throws IOException, DatabaseException {
+ deleteProcessFile();
+
try {
stopReaderProcess();
} catch (Throwable e) {
***************
*** 219,228 ****
ReadOnlyProcess.class.getName(),
};
! /* Start it and give it a chance to open the environment. */
readerProcess = Runtime.getRuntime().exec(cmd);
! Thread.sleep(2000);
//printReaderStatus();
}
private void stopReaderProcess()
--- 242,264 ----
ReadOnlyProcess.class.getName(),
};
! /* Start it and wait for it to open the environment. */
readerProcess = Runtime.getRuntime().exec(cmd);
! long startTime = System.currentTimeMillis();
! boolean running = false;
! while (!running &&
! ((System.currentTimeMillis() - startTime) <
! (READER_STARTUP_SECS * 1000))) {
! if (getProcessFile().exists()) {
! running = true;
! } else {
! Thread.sleep(10);
! }
! }
//printReaderStatus();
+ assertTrue("ReadOnlyProcess did not start after " +
+ READER_STARTUP_SECS + " + secs",
+ running);
}
private void stopReaderProcess()
Index: test/com/sleepycat/je/cleaner/ReadOnlyProcess.java
===================================================================
*** test/com/sleepycat/je/cleaner/ReadOnlyProcess.java 12 Sep 2006 19:17:14 -0000 1.5
--- test/com/sleepycat/je/cleaner/ReadOnlyProcess.java 23 Nov 2006 00:07:40 -0000
***************
*** 16,22 ****
import com.sleepycat.je.util.TestUtils;
/**
! * @see ReadOnlyLockerTest
*/
public class ReadOnlyProcess {
--- 15,21 ----
import com.sleepycat.je.util.TestUtils;
/**
! * @see ReadOnlyLockingTest
*/
public class ReadOnlyProcess {
***************
*** 36,41 ****
--- 35,43 ----
//System.err.println("Opened read-only: " + envHome);
//System.err.println(System.getProperty("java.class.path"));
+
+ /* Notify the test that this process has opened the environment. */
+ ReadOnlyLockingTest.createProcessFile();
/* Sleep until the parent process kills me. */
Thread.sleep(Long.MAX_VALUE);
|