Skip to content

Commit

Permalink
Loosen up heuristic timing test to deal with very slow CI machines
Browse files Browse the repository at this point in the history
  • Loading branch information
nblumhardt committed Jul 8, 2022
1 parent b4c8745 commit 4cbddad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/SerilogTimings/CompletionBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ enum CompletionBehaviour
Complete,
Silent
}
}
}
1 change: 0 additions & 1 deletion src/SerilogTimings/Extensions/LoggerOperationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using Serilog;
using Serilog.Events;
using SerilogTimings.Configuration;
Expand Down
4 changes: 2 additions & 2 deletions src/SerilogTimings/Operation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public enum Properties
readonly long _start;
long? _stop;

IDisposable _popContext;
readonly IDisposable _popContext;
CompletionBehaviour _completionBehaviour;
readonly LogEventLevel _completionLevel;
readonly LogEventLevel _abandonmentLevel;
private readonly TimeSpan? _warningThreshold;
readonly TimeSpan? _warningThreshold;
Exception? _exception;

internal Operation(ILogger target, string messageTemplate, object[] args,
Expand Down
2 changes: 1 addition & 1 deletion test/SerilogTimings.Tests/OperationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public async Task TimingWithinOrderOfMagnitude(int delay)
op.Dispose();

var elapsed = GetElapsedMilliseconds(logger);
Assert.InRange(elapsed, delay * 0.5, delay * 5);
Assert.InRange(elapsed, delay * 0.2, delay * 8);
}

[Fact]
Expand Down

0 comments on commit 4cbddad

Please sign in to comment.