Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
fix #75 concurrent modification issue
Browse files Browse the repository at this point in the history
  • Loading branch information
anshooarora committed Aug 11, 2017
1 parent 55348a9 commit 28fa5a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ExtentReports/ExtentReports/Model/Test.cs
@@ -1,5 +1,6 @@
using System;
using System.Threading;
using System.Runtime.CompilerServices;

using AventStack.ExtentReports.Gherkin.Model;

Expand All @@ -16,7 +17,7 @@ public class Test
public int TestId { get; private set; }
public ExceptionInfo ExceptionInfo { get; set; }
public ObjectId ObjectId { get; set; }
public Status Status { get; private set; }
public Status Status { [MethodImpl(MethodImplOptions.Synchronized)] get; [MethodImpl(MethodImplOptions.Synchronized)] private set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }

Expand Down Expand Up @@ -186,6 +187,7 @@ private void UpdateTestStatusRecursive(Test test)
test.NodeContext().GetAllItems().ForEach(x => UpdateTestStatusRecursive(x));
}

[MethodImpl(MethodImplOptions.Synchronized)]
private void UpdateStatus(Status status)
{
int statusIndex = StatusHierarchy.GetStatusHierarchy().IndexOf(status);
Expand Down

0 comments on commit 28fa5a4

Please sign in to comment.