From b788ae5c2251e0888a5378d6e20b457c56c63929 2020-02-04 16:35:45 From: Christopher Esterhuyse Date: 2020-02-04 16:35:45 Subject: [PATCH] smaller testg --- diff --git a/src/runtime/actors.rs b/src/runtime/actors.rs index da9883dfcec23dab896a5988c0cb850ce770d27f..0a7d62144bfffaa706a0dfce779f7dc7faa818fd 100644 --- a/src/runtime/actors.rs +++ b/src/runtime/actors.rs @@ -79,9 +79,20 @@ impl PolyP { assert!(self.ekeys.contains(&ekey)); let channel_id = r_ctx.m_ctx.inner.endpoint_exts.get(ekey).unwrap().info.channel_id; + lockprintln!( + "{:?}: ~ ... {:?} couldnt read msg for port {:?}. has inbox {:?}", + cid, + m_ctx.my_subtree_id, + channel_id, + &branch.inbox, + ); if predicate.replace_assignment(channel_id, true) != Some(false) { // don't rerun now. Rerun at next `sync_run` + + lockprintln!("{:?}: ~ ... Delay {:?}", cid, m_ctx.my_subtree_id,); self.incomplete.insert(predicate, branch); + } else { + lockprintln!("{:?}: ~ ... Drop {:?}", cid, m_ctx.my_subtree_id,); } // ELSE DROP } diff --git a/src/test/connector.rs b/src/test/connector.rs index 9c80bba69266419dedbd025808a678de844be1fe..423fec99ceb0ff16bc1eac0f95c60f3fe821b71c 100644 --- a/src/test/connector.rs +++ b/src/test/connector.rs @@ -53,3 +53,42 @@ fn duo(one: String, two: String) { handle(a.join()); handle(b.join()); } + +#[test] +fn incremental() { + let timeout = Duration::from_millis(1_500); + let addrs = ["127.0.0.1:7010".parse().unwrap(), "127.0.0.1:7011".parse().unwrap()]; + let a = thread::spawn(move || { + let mut x = Connector::Unconfigured(Unconfigured { controller_id: 0 }); + x.configure( + b"primitive main(out a, out b) { + synchronous { + msg m = create(0); + put(a, m); + } + }", + ) + .unwrap(); + x.bind_port(0, PortBinding::Passive(addrs[0])).unwrap(); + x.bind_port(1, PortBinding::Passive(addrs[1])).unwrap(); + x.connect(timeout).unwrap(); + assert_eq!(0, x.sync(timeout).unwrap()); + }); + let b = thread::spawn(move || { + let mut x = Connector::Unconfigured(Unconfigured { controller_id: 1 }); + x.configure( + b"primitive main(in a, in b) { + synchronous { + get(a); + } + }", + ) + .unwrap(); + x.bind_port(0, PortBinding::Active(addrs[0])).unwrap(); + x.bind_port(1, PortBinding::Active(addrs[1])).unwrap(); + x.connect(timeout).unwrap(); + assert_eq!(0, x.sync(timeout).unwrap()); + }); + handle(a.join()); + handle(b.join()); +}