diff --git a/t/Controller/Admin/clear-queue-non-current.t b/t/Controller/Admin/clear-queue-non-current.t index 630abbdc8..4669fb734 100644 --- a/t/Controller/Admin/clear-queue-non-current.t +++ b/t/Controller/Admin/clear-queue-non-current.t @@ -1,7 +1,7 @@ use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); use File::Copy; my %ctx = test_init( diff --git a/t/Controller/Build/cancel.t b/t/Controller/Build/cancel.t index 5dc5ba8a5..b2afc074b 100644 --- a/t/Controller/Build/cancel.t +++ b/t/Controller/Build/cancel.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/Build/restart.t b/t/Controller/Build/restart.t index 75904ba4e..9a993a111 100644 --- a/t/Controller/Build/restart.t +++ b/t/Controller/Build/restart.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/JobsetEval/cancel.t b/t/Controller/JobsetEval/cancel.t index 03f23e05f..5b8481170 100644 --- a/t/Controller/JobsetEval/cancel.t +++ b/t/Controller/JobsetEval/cancel.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/JobsetEval/restart.t b/t/Controller/JobsetEval/restart.t index c5957cf78..30581987c 100644 --- a/t/Controller/JobsetEval/restart.t +++ b/t/Controller/JobsetEval/restart.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/Root/narinfo.t b/t/Controller/Root/narinfo.t index 297d336b6..0a473a035 100644 --- a/t/Controller/Root/narinfo.t +++ b/t/Controller/Root/narinfo.t @@ -2,7 +2,7 @@ use strict; use warnings; use Setup; use Data::Dumper; -use JSON qw(decode_json); +use JSON::MaybeXS qw(decode_json); my %ctx = test_init( # Without this, the test will fail because a `file:` store is not treated as a # local store by `isLocalStore` in src/lib/Hydra/Helper/Nix.pm, and any diff --git a/t/plugins/RunCommand/basic.t b/t/plugins/RunCommand/basic.t index 4771e6afd..0dfcd79d2 100644 --- a/t/plugins/RunCommand/basic.t +++ b/t/plugins/RunCommand/basic.t @@ -1,7 +1,7 @@ use feature 'unicode_strings'; use strict; use warnings; -use JSON; +use JSON::MaybeXS; use Setup; my %ctx = test_init( @@ -42,7 +42,7 @@ my $dat = do { open(my $json_fh, "<", $filename) or die("Can't open \"$filename\": $!\n"); local $/; - my $json = JSON->new; + my $json = JSON::MaybeXS->new; $json->decode(<$json_fh>) };