Are gopter property tests safe for parallel use?

90 Views Asked by At

I'm using gopter for property testing and I'm interested in speeding up my test runs by running independent tests in parallel.

I can't find any reference in the documentation as to whether it's safe to call t.Parallel() in my test or not. Though, none of the examples that I've found are actually tests, they're all standalone console apps.

For example, here's one of my tests - is it safe to add the marked line?

func Test_NetworkSecurityGroup_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) {
    t.Parallel() // Is this safe?
    parameters := gopter.DefaultTestParameters()
    parameters.MaxSize = 10
    properties := gopter.NewProperties(parameters)
    properties.Property(
        "Round trip from NetworkSecurityGroup to NetworkSecurityGroup via AssignPropertiesToNetworkSecurityGroup & AssignPropertiesFromNetworkSecurityGroup returns original",
        prop.ForAll(RunPropertyAssignmentTestForNetworkSecurityGroup, NetworkSecurityGroupGenerator()))
    properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout))
}

I don't have any crashes when the t.Parallel() call is present, but I'm wary about proceeding without some reference that indicates it may be safe to do so.

0

There are 0 best solutions below