Merge pull request #1033 from TheBlueMatt/2021-07-fix-beta
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Tue, 3 Aug 2021 14:41:35 +0000 (14:41 +0000)
committerGitHub <noreply@github.com>
Tue, 3 Aug 2021 14:41:35 +0000 (14:41 +0000)
Fix lightning-persister tests for upcoming rustc changes

.github/workflows/build.yml
lightning-block-sync/src/http.rs
lightning-persister/src/util.rs

index 100fbdfcff6c66814b8c847d737c4a87a8c4ceb8..738a54f91a50b8159160b8ac09bc16e79fa5c5c3 100644 (file)
@@ -26,10 +26,18 @@ jobs:
             platform: macos-latest
             build-net-tokio: true
             build-no-std: true
+          - toolchain: beta
+            platform: macos-latest
+            build-net-tokio: true
+            build-no-std: true
           - toolchain: stable
             platform: windows-latest
             build-net-tokio: true
             build-no-std: true
+          - toolchain: beta
+            platform: windows-latest
+            build-net-tokio: true
+            build-no-std: true
           - toolchain: beta
             build-net-tokio: true
             build-no-std: true
index 89054a23ffb5a936ad7814bcdcde8a248f20f18a..0721babfde3d1b626051ba1ccccb7240d1f5a5a7 100644 (file)
@@ -636,7 +636,10 @@ pub(crate) mod client_tests {
        #[test]
        fn connect_to_unresolvable_host() {
                match HttpClient::connect(("example.invalid", 80)) {
-                       Err(e) => assert_eq!(e.kind(), std::io::ErrorKind::Other),
+                       Err(e) => {
+                               assert!(e.to_string().contains("failed to lookup address information") ||
+                                       e.to_string().contains("No such host"), "{:?}", e);
+                       },
                        Ok(_) => panic!("Expected error"),
                }
        }
index 1825980ad891fcb257cdaf956150a526ac5e326d..73b28985bfff6ae8b484e5f0d76c62e4091b3541 100644 (file)
@@ -135,7 +135,7 @@ mod tests {
                // Create the channel data file and make it a directory.
                fs::create_dir_all(get_full_filepath(path.clone(), filename.to_string())).unwrap();
                match write_to_file(path.clone(), filename.to_string(), &test_writeable) {
-                       Err(e) => assert_eq!(e.kind(), io::ErrorKind::Other),
+                       Err(e) => assert_eq!(e.raw_os_error(), Some(libc::EISDIR)),
                        _ => panic!("Unexpected Ok(())")
                }
                fs::remove_dir_all(path).unwrap();
@@ -178,7 +178,7 @@ mod tests {
                match write_to_file(path, filename, &test_writeable) {
                        Err(e) => {
                                #[cfg(not(target_os = "windows"))]
-                               assert_eq!(e.kind(), io::ErrorKind::Other);
+                               assert_eq!(e.raw_os_error(), Some(libc::EISDIR));
                                #[cfg(target_os = "windows")]
                                assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
                        }