about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHenry Jiang <henry.jiang1@ibm.com>2025-03-03 15:40:23 -0500
committerHenry Jiang <henry.jiang1@ibm.com>2025-03-04 10:06:28 -0500
commit2a7ad952a7a7120a76feadc72b24c40233aedf31 (patch)
tree0ec5073f923bc8021a6fb072f4b963abaac1d385
parent81d8edc2000aa38b08ad09fce22d90f1990b6459 (diff)
downloadrust-2a7ad952a7a7120a76feadc72b24c40233aedf31.tar.gz
rust-2a7ad952a7a7120a76feadc72b24c40233aedf31.zip
Fix test hangs on AIX
-rw-r--r--library/std/src/net/test.rs11
-rw-r--r--library/std/src/net/udp/tests.rs12
-rw-r--r--tests/debuginfo/pretty-huge-vec.rs1
-rw-r--r--tests/ui/consts/large_const_alloc.rs3
-rw-r--r--tests/ui/consts/large_const_alloc.stderr4
-rw-r--r--tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs3
-rw-r--r--tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr2
7 files changed, 29 insertions, 7 deletions
diff --git a/library/std/src/net/test.rs b/library/std/src/net/test.rs
index a5c3983cd89..df48b2f2420 100644
--- a/library/std/src/net/test.rs
+++ b/library/std/src/net/test.rs
@@ -31,3 +31,14 @@ pub fn tsa<A: ToSocketAddrs>(a: A) -> Result<Vec<SocketAddr>, String> {
         Err(e) => Err(e.to_string()),
     }
 }
+
+pub fn compare_ignore_zoneid(a: &SocketAddr, b: &SocketAddr) -> bool {
+    match (a, b) {
+        (SocketAddr::V6(a), SocketAddr::V6(b)) => {
+            a.ip().segments() == b.ip().segments()
+                && a.flowinfo() == b.flowinfo()
+                && a.port() == b.port()
+        }
+        _ => a == b,
+    }
+}
diff --git a/library/std/src/net/udp/tests.rs b/library/std/src/net/udp/tests.rs
index 1c8c58d1879..91da3135f97 100644
--- a/library/std/src/net/udp/tests.rs
+++ b/library/std/src/net/udp/tests.rs
@@ -1,4 +1,4 @@
-use crate::net::test::{next_test_ip4, next_test_ip6};
+use crate::net::test::{compare_ignore_zoneid, next_test_ip4, next_test_ip6};
 use crate::net::*;
 use crate::sync::mpsc::channel;
 use crate::thread;
@@ -46,7 +46,7 @@ fn socket_smoke_test_ip4() {
         let (nread, src) = t!(server.recv_from(&mut buf));
         assert_eq!(nread, 1);
         assert_eq!(buf[0], 99);
-        assert_eq!(src, client_ip);
+        assert_eq!(compare_ignore_zoneid(&src, &client_ip), true);
         rx2.recv().unwrap();
     })
 }
@@ -78,7 +78,9 @@ fn udp_clone_smoke() {
 
         let _t = thread::spawn(move || {
             let mut buf = [0, 0];
-            assert_eq!(sock2.recv_from(&mut buf).unwrap(), (1, addr1));
+            let res = sock2.recv_from(&mut buf).unwrap();
+            assert_eq!(res.0, 1);
+            assert_eq!(compare_ignore_zoneid(&res.1, &addr1), true);
             assert_eq!(buf[0], 1);
             t!(sock2.send_to(&[2], &addr1));
         });
@@ -94,7 +96,9 @@ fn udp_clone_smoke() {
         });
         tx1.send(()).unwrap();
         let mut buf = [0, 0];
-        assert_eq!(sock1.recv_from(&mut buf).unwrap(), (1, addr2));
+        let res = sock1.recv_from(&mut buf).unwrap();
+        assert_eq!(res.0, 1);
+        assert_eq!(compare_ignore_zoneid(&res.1, &addr2), true);
         rx2.recv().unwrap();
     })
 }
diff --git a/tests/debuginfo/pretty-huge-vec.rs b/tests/debuginfo/pretty-huge-vec.rs
index 093fbc5b12d..6938158e365 100644
--- a/tests/debuginfo/pretty-huge-vec.rs
+++ b/tests/debuginfo/pretty-huge-vec.rs
@@ -1,5 +1,6 @@
 //@ ignore-windows-gnu: #128981
 //@ ignore-android: FIXME(#10381)
+//@ ignore-aix: FIXME(#137965)
 //@ compile-flags:-g
 
 // === GDB TESTS ===================================================================================
diff --git a/tests/ui/consts/large_const_alloc.rs b/tests/ui/consts/large_const_alloc.rs
index 14edc1bb696..3573a018630 100644
--- a/tests/ui/consts/large_const_alloc.rs
+++ b/tests/ui/consts/large_const_alloc.rs
@@ -2,6 +2,9 @@
 // on 32bit and 16bit platforms it is plausible that the maximum allocation size will succeed
 // FIXME (#135952) In some cases on AArch64 Linux the diagnostic does not trigger
 //@ ignore-aarch64-unknown-linux-gnu
+// AIX will allow the allocation to go through, and get SIGKILL when zero initializing
+// the overcommitted page.
+//@ ignore-aix
 
 const FOO: () = {
     // 128 TiB, unlikely anyone has that much RAM
diff --git a/tests/ui/consts/large_const_alloc.stderr b/tests/ui/consts/large_const_alloc.stderr
index fa7d5977a95..f3f3de7af63 100644
--- a/tests/ui/consts/large_const_alloc.stderr
+++ b/tests/ui/consts/large_const_alloc.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/large_const_alloc.rs:8:13
+  --> $DIR/large_const_alloc.rs:11:13
    |
 LL |     let x = [0_u8; (1 << 47) - 1];
    |             ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
 
 error[E0080]: could not evaluate static initializer
-  --> $DIR/large_const_alloc.rs:13:13
+  --> $DIR/large_const_alloc.rs:16:13
    |
 LL |     let x = [0_u8; (1 << 47) - 1];
    |             ^^^^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler
diff --git a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs
index 53618e2e86a..75765596fa1 100644
--- a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs
+++ b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs
@@ -5,6 +5,9 @@
 //@ only-64bit
 // FIXME (#135952) In some cases on AArch64 Linux the diagnostic does not trigger
 //@ ignore-aarch64-unknown-linux-gnu
+// AIX will allow the allocation to go through, and get SIGKILL when zero initializing
+// the overcommitted page.
+//@ ignore-aix
 
 pub struct Data([u8; (1 << 47) - 1]);
 const _: &'static Data = &Data([0; (1 << 47) - 1]);
diff --git a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr
index aac805dbd8c..02180c1e4c6 100644
--- a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr
+++ b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/promoted_running_out_of_memory_issue-130687.rs:10:32
+  --> $DIR/promoted_running_out_of_memory_issue-130687.rs:13:32
    |
 LL | const _: &'static Data = &Data([0; (1 << 47) - 1]);
    |                                ^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler