private async Task InitOnEntry() { this.SendEvent(this.Id, UnitEvent.Instance); await AsyncProvider.DelayAsync(10).ConfigureAwait(false); this.SendEvent(this.Id, UnitEvent.Instance); }
protected override async Task OnInitializeAsync(Event initialEvent) { this.SendEvent(this.Id, UnitEvent.Instance); await AsyncProvider.DelayAsync(10).ConfigureAwait(false); this.SendEvent(this.Id, UnitEvent.Instance); }
public void TestDetectedUncontrolledDelay() { this.Test(async() => { await AsyncProvider.DelayAsync(100); }, configuration: this.GetConfiguration() .WithPartiallyControlledConcurrencyAllowed() .WithTestingIterations(10)); }
public void TestFuzzingFallbackAfterUncontrolledDelay() { var configuration = this.GetConfiguration(). WithSystematicFuzzingFallbackEnabled(true). WithTestingIterations(10); this.Test(async() => { // This would fail during SCT due to uncontrolled concurrency, // but the fuzzing fallback mechanism should prevent it. await AsyncProvider.DelayAsync(1); }, configuration); }
public void TestDetectedUncontrolledDelay() { this.TestWithError(async() => { await AsyncProvider.DelayAsync(100); }, configuration: GetConfiguration().WithTestingIterations(100), errorChecker: (e) => { string expectedMethodName = $"{typeof(AsyncProvider).FullName}.{nameof(AsyncProvider.DelayAsync)}"; Assert.StartsWith($"Method '{expectedMethodName}' returned an uncontrolled task", e); }, replay: true); }
public void TestDetectedUncontrolledDelayWithNoPartialControl() { this.TestWithError(async() => { await AsyncProvider.DelayAsync(100); }, configuration: this.GetConfiguration().WithTestingIterations(10), errorChecker: (e) => { var expectedMethodName = GetFullyQualifiedMethodName(typeof(AsyncProvider), nameof(AsyncProvider.DelayAsync)); Assert.StartsWith($"Invoking '{expectedMethodName}' returned task", e); }, replay: true); }
private async Task DelayedRandomAsync() { await AsyncProvider.DelayAsync(10).ConfigureAwait(false); this.RandomBoolean(); }