diff --git a/p2p/discv5/node_test.go b/p2p/discv5/node_test.go
index ce4ad9e4d48ef945557892c2222a528fb333fda6..c231345db2e455e25fb61794e1e54afd41e43cbb 100644
--- a/p2p/discv5/node_test.go
+++ b/p2p/discv5/node_test.go
@@ -152,7 +152,7 @@ func TestParseNode(t *testing.T) {
 			if err == nil {
 				t.Errorf("test %q:\n  got nil error, expected %#q", test.rawurl, test.wantError)
 				continue
-			} else if err.Error() != test.wantError {
+			} else if !strings.Contains(err.Error(), test.wantError) {
 				t.Errorf("test %q:\n  got error %#q, expected %#q", test.rawurl, err.Error(), test.wantError)
 				continue
 			}
diff --git a/p2p/enode/urlv4_test.go b/p2p/enode/urlv4_test.go
index 69ed1110213b1781da6569df565a82d3eb64c6be..12399d291c1d8d5618ad8c61e04a2b1a383724fd 100644
--- a/p2p/enode/urlv4_test.go
+++ b/p2p/enode/urlv4_test.go
@@ -162,7 +162,7 @@ func TestParseNode(t *testing.T) {
 			if err == nil {
 				t.Errorf("test %q:\n  got nil error, expected %#q", test.input, test.wantError)
 				continue
-			} else if err.Error() != test.wantError {
+			} else if !strings.Contains(err.Error(), test.wantError) {
 				t.Errorf("test %q:\n  got error %#q, expected %#q", test.input, err.Error(), test.wantError)
 				continue
 			}