@@ -48,7 +48,7 @@ a pull request for tc-nightly-main branch and after merging build a new
48
48
artifact using:
49
49
50
50
# install build dependencies and build tools
51
- sudo apt-get -qqy install openjdk-8 -jre openjdk-8 -jre-headless libjna-java gnuplot
51
+ sudo apt-get -qqy install openjdk-17 -jre openjdk-17 -jre-headless libjna-java gnuplot
52
52
curl -o lein https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
53
53
chmod +x lein
54
54
@@ -74,7 +74,7 @@ to running roachtest and update repository URLs in the file to your liking.
74
74
const envBuildJepsen = "ROACHTEST_BUILD_JEPSEN"
75
75
76
76
const jepsenRepo = "https://github.com/cockroachdb/jepsen"
77
- const repoBranch = "tc-nightly"
77
+ const repoBranch = "tc-nightly-main "
78
78
79
79
const gcpPath = "https://storage.googleapis.com/cockroach-jepsen"
80
80
const binaryVersion = "0.1.0-6699eb4-standalone"
@@ -119,7 +119,7 @@ func initJepsen(ctx context.Context, t test.Test, c cluster.Cluster, j jepsenCon
119
119
// so do it before the initialization check for ease of iteration.
120
120
if err := c .GitClone (
121
121
ctx , t .L (),
122
- "https://github.com/cockroachdb/jepsen" , "/mnt/data1/jepsen" , "tc-nightly" , controller ,
122
+ jepsenRepo , "/mnt/data1/jepsen" , repoBranch , controller ,
123
123
); err != nil {
124
124
t .Fatal (err )
125
125
}
@@ -163,10 +163,11 @@ func initJepsen(ctx context.Context, t test.Test, c cluster.Cluster, j jepsenCon
163
163
// (which is not how our official builds are laid out).
164
164
c .Run (ctx , option .WithNodes (c .All ()), "tar --transform s,^,cockroach/, -c -z -f cockroach.tgz cockroach" )
165
165
166
+ deps := `"sudo DEBIAN_FRONTEND=noninteractive apt-get -qqy install openjdk-17-jre openjdk-17-jre-headless libjna-java gnuplot > /dev/null 2>&1"`
167
+
166
168
// Install Jepsen's prereqs on the controller.
167
169
if result , err := c .RunWithDetailsSingleNode (
168
- ctx , t .L (), option .WithNodes (controller ), "sh" , "-c" ,
169
- `"sudo DEBIAN_FRONTEND=noninteractive apt-get -qqy install openjdk-17-jre openjdk-17-jre-headless libjna-java gnuplot > /dev/null 2>&1"` ,
170
+ ctx , t .L (), option .WithNodes (controller ), "sh" , "-c" , deps ,
170
171
); err != nil {
171
172
if result .RemoteExitStatus == 100 {
172
173
t .Skip ("apt-get failure (#31944)" , result .Stdout + result .Stderr )
@@ -211,7 +212,7 @@ type jepsenConfig struct {
211
212
}
212
213
213
214
func makeJepsenConfig () jepsenConfig {
214
- if e := os .Getenv (envBuildJepsen ); e != "" {
215
+ if os .Getenv (envBuildJepsen ) != "" {
215
216
return jepsenConfig {
216
217
buildFromSource : true ,
217
218
repoURL : jepsenRepo ,
@@ -267,6 +268,8 @@ func (j jepsenConfig) startTest(
267
268
ctx context.Context , t test.Test , run func (args ... string ) error , testArgs string ,
268
269
) <- chan error {
269
270
errCh := make (chan error , 1 )
271
+ var script string
272
+
270
273
if j .buildFromSource {
271
274
// Install the jepsen package (into ~/.m2) before running tests in
272
275
// the cockroach package. Clojure doesn't really understand
@@ -288,20 +291,28 @@ func (j jepsenConfig) startTest(
288
291
}
289
292
t .Fatalf ("error installing Jepsen deps: %+v" , err )
290
293
}
291
- t .Go (func (context.Context , * logger.Logger ) error {
292
- errCh <- run ("bash" , "-e" , "-c" , fmt .Sprintf (
293
- `"cd /mnt/data1/jepsen/cockroachdb && set -eo pipefail && ~/lein run %s > invoke.log 2>&1"` ,
294
- testArgs ))
295
- return nil
296
- })
294
+ // N.B. jepsen exits with `255` if it encounters an unhandled exception.
295
+ // (See https://github.com/cockroachdb/cockroach/issues/99681)
296
+ // 255 is designated as SSH, hence we remap it to 254 below. (See errors.ClassifyCmdError)
297
+ script = fmt .Sprintf (`"
298
+ cd /mnt/data1/jepsen/cockroachdb &&
299
+ set -eo pipefail &&
300
+ rc=0; ~/lein run %s > invoke.log 2>&1 || rc=\$?;
301
+ exit \$(( rc == 255 ? 254 : rc ))"` , testArgs )
297
302
} else {
298
- t .Go (func (context.Context , * logger.Logger ) error {
299
- errCh <- run ("bash" , "-e" , "-c" , fmt .Sprintf (
300
- `"cd /mnt/data1/jepsen/cockroachdb && set -eo pipefail && java -jar %s %s > invoke.log 2>&1"` ,
301
- j .binaryName (), testArgs ))
302
- return nil
303
- })
303
+ // N.B. jepsen exits with `255` if it encounters an unhandled exception.
304
+ // (See https://github.com/cockroachdb/cockroach/issues/99681)
305
+ // 255 is designated as SSH, hence we remap it to 254 below. (See errors.ClassifyCmdError)
306
+ script = fmt .Sprintf (`"
307
+ cd /mnt/data1/jepsen/cockroachdb &&
308
+ set -eo pipefail &&
309
+ rc=0; java -jar %s %s > invoke.log 2>&1 || rc=\$?;
310
+ exit \$(( rc == 255 ? 254 : rc ))"` , j .binaryName (), testArgs )
304
311
}
312
+ t .Go (func (context.Context , * logger.Logger ) error {
313
+ errCh <- run ("bash" , "-e" , "-c" , script )
314
+ return nil
315
+ })
305
316
return errCh
306
317
}
307
318
0 commit comments