@@ -70,25 +70,18 @@ public void Dispose()
70
70
[ Test ]
71
71
public void TestConcurrentChannelOpenWithPublishing ( )
72
72
{
73
- foreach ( var i in Enumerable . Range ( 0 , threads ) )
74
- {
75
- var t = new Thread ( ( ) => {
76
- // publishing on a shared channel is not supported
77
- // and would missing the point of this test anyway
78
- var ch = Conn . CreateModel ( ) ;
79
- ch . ConfirmSelect ( ) ;
80
- foreach ( var j in Enumerable . Range ( 0 , 10000 ) )
81
- {
82
- var body = Encoding . ASCII . GetBytes ( string . Empty ) ;
83
- ch . BasicPublish ( exchange : "" , routingKey : "_______" , basicProperties : ch . CreateBasicProperties ( ) , body : body ) ;
84
- }
85
- ch . WaitForConfirms ( TimeSpan . FromSeconds ( 40 ) ) ;
86
- latch . Signal ( ) ;
87
- } ) ;
88
- t . Start ( ) ;
89
- }
90
-
91
- Assert . IsTrue ( latch . Wait ( TimeSpan . FromSeconds ( 90 ) ) ) ;
73
+ TestConcurrentChannelOperations ( ( conn ) => {
74
+ // publishing on a shared channel is not supported
75
+ // and would missing the point of this test anyway
76
+ var ch = Conn . CreateModel ( ) ;
77
+ ch . ConfirmSelect ( ) ;
78
+ foreach ( var j in Enumerable . Range ( 0 , 500 ) )
79
+ {
80
+ var body = Encoding . ASCII . GetBytes ( string . Empty ) ;
81
+ ch . BasicPublish ( exchange : "" , routingKey : "_______" , basicProperties : ch . CreateBasicProperties ( ) , body : body ) ;
82
+ }
83
+ ch . WaitForConfirms ( TimeSpan . FromSeconds ( 40 ) ) ;
84
+ } , 30 ) ;
92
85
}
93
86
94
87
// note: refactoring this further to use an Action causes .NET Core 1.x
@@ -99,7 +92,7 @@ public void TestConcurrentChannelOpenCloseLoop()
99
92
TestConcurrentChannelOperations ( ( conn ) => {
100
93
var ch = conn . CreateModel ( ) ;
101
94
ch . Close ( ) ;
102
- } , 100 ) ;
95
+ } , 50 ) ;
103
96
}
104
97
105
98
protected void TestConcurrentChannelOperations ( Action < IConnection > actions ,
0 commit comments