Skip to content

Commit c5b6eae

Browse files
niemyjskiejsmith
authored andcommitted
More test improvements
1 parent 31b020e commit c5b6eae

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

test/Exceptionless.Tests/Plugins/PluginTests.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ public void VerifyDeduplication() {
781781
var errorPlugin = new SimpleErrorPlugin();
782782

783783
EventPluginContext mergedContext = null;
784-
using (var duplicateCheckerPlugin = new DuplicateCheckerPlugin(TimeSpan.FromMilliseconds(40))) {
784+
using (var duplicateCheckerPlugin = new DuplicateCheckerPlugin(TimeSpan.FromSeconds(1))) {
785785
for (int index = 0; index < 10; index++) {
786786
var builder = GetException().ToExceptionless();
787787
var context = new EventPluginContext(client, builder.Target, builder.PluginContextData);
@@ -808,22 +808,24 @@ public void VerifyDeduplicationPluginWillCallSubmittingHandler() {
808808
var client = CreateClient();
809809
foreach (var plugin in client.Configuration.Plugins)
810810
client.Configuration.RemovePlugin(plugin.Key);
811-
client.Configuration.AddPlugin(new DuplicateCheckerPlugin(TimeSpan.FromMilliseconds(75)));
812811

813812
int submittingEventHandlerCalls = 0;
814-
client.SubmittingEvent += (sender, args) => {
815-
Interlocked.Increment(ref submittingEventHandlerCalls);
816-
};
813+
using (var duplicateCheckerPlugin = new DuplicateCheckerPlugin(TimeSpan.FromSeconds(1))) {
814+
client.Configuration.AddPlugin(duplicateCheckerPlugin);
817815

818-
for (int index = 0; index < 3; index++) {
819-
client.SubmitLog("test");
820-
if (index > 0)
821-
continue;
816+
client.SubmittingEvent += (sender, args) => {
817+
Interlocked.Increment(ref submittingEventHandlerCalls);
818+
};
819+
820+
for (int index = 0; index < 3; index++) {
821+
client.SubmitLog("test");
822+
if (index > 0)
823+
continue;
822824

823-
Assert.Equal(1, submittingEventHandlerCalls);
825+
Assert.Equal(1, submittingEventHandlerCalls);
826+
}
824827
}
825828

826-
Thread.Sleep(100);
827829
Assert.Equal(2, submittingEventHandlerCalls);
828830
}
829831

0 commit comments

Comments
 (0)