Skip to content

Commit ff14423

Browse files
committed
reduce the execution time from 7.4 to 1.6 seconds
1 parent 1d6c4cf commit ff14423

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/src/com/rabbitmq/client/test/functional/PerQueueTTL.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ public void testQueueRedeclareSemanticNonEquivalence() throws Exception {
117117
* Test messages expire when using basic get.
118118
*/
119119
public void testPublishAndGetWithExpiry() throws Exception {
120-
declareAndBindQueue(2000);
120+
declareAndBindQueue(200);
121121

122122
publish(MSG[0]);
123-
Thread.sleep(1500);
123+
Thread.sleep(150);
124124

125125
publish(MSG[1]);
126-
Thread.sleep(1000);
126+
Thread.sleep(100);
127127

128128
publish(MSG[2]);
129129

@@ -136,19 +136,19 @@ public void testPublishAndGetWithExpiry() throws Exception {
136136
* Test get expiry for messages sent under a transaction
137137
*/
138138
public void testTransactionalPublishWithGet() throws Exception {
139-
declareAndBindQueue(1000);
139+
declareAndBindQueue(100);
140140

141141
this.channel.txSelect();
142142

143143
publish(MSG[0]);
144-
Thread.sleep(1500);
144+
Thread.sleep(150);
145145

146146
publish(MSG[1]);
147147
this.channel.txCommit();
148-
Thread.sleep(500);
148+
Thread.sleep(50);
149149

150150
assertEquals(MSG[0], new String(get()));
151-
Thread.sleep(800);
151+
Thread.sleep(80);
152152

153153
assertNull(get());
154154
}
@@ -157,10 +157,10 @@ public void testTransactionalPublishWithGet() throws Exception {
157157
* Test expiry of requeued messages
158158
*/
159159
public void testExpiryWithRequeue() throws Exception {
160-
declareAndBindQueue(1000);
160+
declareAndBindQueue(100);
161161

162162
publish(MSG[0]);
163-
Thread.sleep(500);
163+
Thread.sleep(50);
164164
publish(MSG[1]);
165165
publish(MSG[2]);
166166

@@ -170,7 +170,7 @@ public void testExpiryWithRequeue() throws Exception {
170170
closeChannel();
171171
openChannel();
172172

173-
Thread.sleep(600);
173+
Thread.sleep(60);
174174
expectBodyAndRemainingMessages(MSG[1], 1);
175175
expectBodyAndRemainingMessages(MSG[2], 0);
176176
}

0 commit comments

Comments
 (0)