File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -1342,3 +1342,38 @@ unittest
13421342 node_tid = node_2.tid;
13431343 node_1.check();
13441344}
1345+
1346+ // request timeouts with dropped messages
1347+ unittest
1348+ {
1349+ static import std.concurrency ;
1350+ import std.exception ;
1351+
1352+ __gshared C.Tid node_tid;
1353+
1354+ static interface API
1355+ {
1356+ void check ();
1357+ int ping ();
1358+ }
1359+
1360+ static class Node : API
1361+ {
1362+ override int ping () { return 42 ; }
1363+
1364+ override void check ()
1365+ {
1366+ auto node = new RemoteAPI! API (node_tid, 420. msecs);
1367+
1368+ // Requests are dropped, so it times out
1369+ assert (node.ping() == 42 );
1370+ node.ctrl.sleep(10. msecs, true );
1371+ assertThrown! Exception (node.ping());
1372+ }
1373+ }
1374+
1375+ auto node_1 = RemoteAPI! API .spawn! Node();
1376+ auto node_2 = RemoteAPI! API .spawn! Node();
1377+ node_tid = node_2.tid;
1378+ node_1.check();
1379+ }
You can’t perform that action at this time.
0 commit comments