From 4e6d57b763769d91c585652aee6d28463f670b71 Mon Sep 17 00:00:00 2001 From: "tsaitsung-han.tht" Date: Wed, 11 Sep 2024 10:48:20 +0800 Subject: [PATCH] Fix codespell and license issue --- csharp/tests/ClientManagerTest.cs | 17 +++++++++++++++++ csharp/tests/ProcessQueueTest.cs | 7 +++---- csharp/tests/PushConsumerTest.cs | 17 +++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/csharp/tests/ClientManagerTest.cs b/csharp/tests/ClientManagerTest.cs index ff66dd61..5e4e7eef 100644 --- a/csharp/tests/ClientManagerTest.cs +++ b/csharp/tests/ClientManagerTest.cs @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections.Concurrent; using Apache.Rocketmq.V2; diff --git a/csharp/tests/ProcessQueueTest.cs b/csharp/tests/ProcessQueueTest.cs index 1c1b00a0..947fbb62 100644 --- a/csharp/tests/ProcessQueueTest.cs +++ b/csharp/tests/ProcessQueueTest.cs @@ -126,7 +126,7 @@ public async Task TestEraseMessageWithConsumeOk() } [TestMethod] - public async Task TestEraseMessageWithFailure() + public async Task TestEraseMessageWithAckFailure() { var pushConsumer = CreateAndSetupPushConsumer(); var messageView = CreateMessageView(); @@ -138,12 +138,11 @@ public async Task TestEraseMessageWithFailure() processQueue.CacheMessages(new List { messageView }); var ackTimes = 3; - var tolerance = TimeSpan.FromMilliseconds(500); processQueue.EraseMessage(messageView, ConsumeResult.SUCCESS); - await Task.Delay(ProcessQueue.AckMessageFailureBackoffDelay * ackTimes + tolerance); + await Task.Delay(ProcessQueue.AckMessageFailureBackoffDelay * ackTimes); - mockClientManager.Verify(cm => cm.AckMessage(It.IsAny(), It.IsAny(), It.IsAny()), Times.AtLeast(ackTimes)); + mockClientManager.Verify(cm => cm.AckMessage(It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(ackTimes)); } private void MockReceiveMessage(Mock mockClientManager, PushConsumer pushConsumer, List responses) diff --git a/csharp/tests/PushConsumerTest.cs b/csharp/tests/PushConsumerTest.cs index d2eeacff..c5cb751a 100644 --- a/csharp/tests/PushConsumerTest.cs +++ b/csharp/tests/PushConsumerTest.cs @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System; using System.Collections.Concurrent; using System.Threading;