message: Fix random errors in test compiler_json_error_format.
diff: @@ -3996,27 +3996,20 @@ fn compiler_json_error_format() {
  .file("bar/src/lib.rs", r#"fn dead() {}"#)
  .build();
  + // Using jobs=1 to ensure that the order of messages is consistent.
  assert_that(
  - p.cargo("build")
  - .arg("-v")
  - .arg("--message-format")
  - .arg("json"),
  + p.cargo("build -v --message-format=json --jobs=1"),
  execs().with_status(0).with_json(
  r#"
  {
  - "reason":"compiler-message",
  - "package_id":"bar 0.5.0 ([..])",
  + "reason":"compiler-artifact",
  + "package_id":"foo 0.5.0 ([..])",
  "target":{
  - "kind":["lib"],
  - "crate_types":["lib"],
  - "name":"bar",
  - "src_path":"[..]lib.rs"
  + "kind":["custom-build"],
  + "crate_types":["bin"],
  + "name":"build-script-build",
  + "src_path":"[..]build.rs"
  },
  - "message":"{...}"
  - }
  -
  - {
  - "reason":"compiler-artifact",
  "profile": {
  "debug_assertions": true,
  "debuginfo": 2,
  @@ -4025,6 +4018,12 @@ fn compiler_json_error_format() {
  "test": false
  },
  "features": [],
  + "filenames": "{...}",
  + "fresh": false
  + }
  +
  + {
  + "reason":"compiler-message",
  "package_id":"bar 0.5.0 ([..])",
  "target":{
  "kind":["lib"],
  @@ -4032,19 +4031,11 @@ fn compiler_json_error_format() {
  "name":"bar",
  "src_path":"[..]lib.rs"
  },
  - "filenames":["[..].rlib"],
  - "fresh": false
  + "message":"{...}"
  }
  {
  "reason":"compiler-artifact",
  - "package_id":"foo 0.5.0 ([..])",
  - "target":{
  - "kind":["custom-build"],
  - "crate_types":["bin"],
  - "name":"build-script-build",
  - "src_path":"[..]build.rs"
  - },
  "profile": {
  "debug_assertions": true,
  "debuginfo": 2,
  @@ -4053,7 +4044,14 @@ fn compiler_json_error_format() {
  "test": false
  },
  "features": [],
  - "filenames": "{...}",
  + "package_id":"bar 0.5.0 ([..])",
  + "target":{
  + "kind":["lib"],
  + "crate_types":["lib"],
  + "name":"bar",
  + "src_path":"[..]lib.rs"
  + },
  + "filenames":["[..].rlib"],
  "fresh": false
  }
  @@ -4105,10 +4103,7 @@ fn compiler_json_error_format() {
  // With fresh build, we should repeat the artifacts,
  // but omit compiler warnings.
  assert_that(
  - p.cargo("build")
  - .arg("-v")
  - .arg("--message-format")
  - .arg("json"),
  + p.cargo("build -v --message-format=json --jobs=1"),
  execs().with_status(0).with_json(
  r#"
  {
  