Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue in WaiterWaiter caused by race condition #4829

Merged
merged 5 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Microsoft.ML.Data/DataView/CacheDataView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,11 @@ public bool Wait(long pos)
{
foreach (var w in _waiters)
w.Wait(pos);
return pos < _parent._rowCount || _parent._rowCount == -1;

// _parent._rowCount may or may not be initialized at this point. Only read the value once
// to avoid race conditions.
var rowCount = _parent._rowCount;
return rowCount == -1 || pos < rowCount;
}
sharwell marked this conversation as resolved.
Show resolved Hide resolved

public static Wrapper Create(CacheDataView parent, Func<int, bool> pred)
Expand Down
12 changes: 0 additions & 12 deletions test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2640,8 +2640,6 @@ public void EntryPointEvaluateMulticlass()
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void EntryPointEvaluateRegression()
{
var dataPath = GetDataPath(TestDatasets.generatedRegressionDatasetmacro.trainFilename);
Expand Down Expand Up @@ -2752,8 +2750,6 @@ public void EntryPointLightGbmMulticlass()
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void EntryPointSdcaBinary()
{
TestEntryPointRoutine("breast-cancer.txt", "Trainers.StochasticDualCoordinateAscentBinaryClassifier");
Expand All @@ -2766,8 +2762,6 @@ public void EntryPointSDCAMulticlass()
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void EntryPointSDCARegression()
{
TestEntryPointRoutine(TestDatasets.generatedRegressionDatasetmacro.trainFilename, "Trainers.StochasticDualCoordinateAscentRegressor", loader: TestDatasets.generatedRegressionDatasetmacro.loaderSettings);
Expand Down Expand Up @@ -3855,8 +3849,6 @@ public void EntryPointChainedTrainTestMacros()
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void EntryPointChainedCrossValMacros()
{
string inputGraph = @"
Expand Down Expand Up @@ -5506,8 +5498,6 @@ public void TestCrossValidationMacroMulticlassWithWarnings()
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void TestCrossValidationMacroWithStratification()
{
var dataPath = GetDataPath(@"breast-cancer.txt");
Expand Down Expand Up @@ -6039,8 +6029,6 @@ public void TestCrossValidationMacroWithNonDefaultNames()
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void TestOvaMacro()
{
var dataPath = GetDataPath(@"iris.txt");
Expand Down
2 changes: 0 additions & 2 deletions test/Microsoft.ML.Functional.Tests/IntrospectiveTraining.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ public void InspectLdaModelParameters()
/// Introspective Training: Linear model parameters may be inspected.
/// </summary>
[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void InpsectLinearModelParameters()
{
var mlContext = new MLContext(seed: 1);
Expand Down
4 changes: 0 additions & 4 deletions test/Microsoft.ML.Predictor.Tests/TestPredictors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ public void KMeansClusteringTest()
[X64Fact("x86 output differs from Baseline")]
[TestCategory("Binary")]
[TestCategory("SDCA")]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void LinearClassifierTest()
{
var binaryPredictors = new[]
Expand Down Expand Up @@ -324,8 +322,6 @@ public void BinaryClassifierLogisticRegressionNormTest()
///</summary>
[LessThanNetCore30OrNotNetCoreAndX64Fact("netcoreapp3.0 and x86 output differs from Baseline")]
[TestCategory("Binary")]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void BinaryClassifierLogisticRegressionNonNegativeTest()
{
var binaryPredictors = new[] { TestLearners.logisticRegressionNonNegative };
Expand Down
2 changes: 0 additions & 2 deletions test/Microsoft.ML.TestFramework/DataPipe/TestDataPipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,6 @@ public void SavePipeTrainAndScoreFccFastTree()

[TestCategory("DataPipeSerialization")]
[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void SavePipeTrainAndScoreFccTransformStr()
{
TestCore(null, false,
Expand Down
2 changes: 0 additions & 2 deletions test/Microsoft.ML.Tests/OnnxConversionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,6 @@ public void LogisticRegressionOnnxConversionTest()
}

[LightGBMFact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void LightGbmBinaryClassificationOnnxConversionTest()
{
// Step 1: Create and train a ML.NET pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ private void TrainRegression(string trainDataPath, string testDataPath, string m
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void TrainRegressionModel()
=> TrainRegression(GetDataPath(TestDatasets.generatedRegressionDataset.trainFilename), GetDataPath(TestDatasets.generatedRegressionDataset.testFilename),
DeleteOutputPath("cook_model.zip"));
Expand Down Expand Up @@ -293,8 +291,6 @@ private void PredictOnIris(ITransformer model)
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void TrainAndPredictOnIris()
=> PredictOnIris(TrainOnIris(GetDataPath("iris.data")));

Expand Down Expand Up @@ -629,8 +625,6 @@ private void CategoricalFeaturizationOn(params string[] dataPath)
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void CrossValidationIris()
=> CrossValidationOn(GetDataPath("iris.data"));

Expand Down Expand Up @@ -708,8 +702,6 @@ public class OutputRow
}

[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void CustomTransformer()
{
var mlContext = new MLContext(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ namespace Microsoft.ML.Scenarios
public partial class ScenariosTests : BaseTestClass
{
[Fact]
//Skipping test temporarily. This test will be re-enabled once the cause of failures has been determined
[Trait("Category", "SkipInCI")]
public void TrainAndPredictIrisModelTest()
{
var mlContext = new MLContext(seed: 1);
Expand Down