Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
01fd4cc
Fix pedantic IDE warnings in asset registry
Helco Oct 22, 2024
028cfa9
Add first two test cases
Helco Oct 22, 2024
288e86b
Fix AssetHandle equality and add more test cases
Helco Oct 22, 2024
3d2ac04
Add even more test cases
Helco Oct 23, 2024
7bbee8e
You guessed it.
Helco Oct 23, 2024
4421884
Fix WaitAsyncAll not checking disposed handles
Helco Oct 24, 2024
9bbf0f6
Add TestCases for applying async assets
Helco Oct 24, 2024
99443de
Add first batch of secondary asset tests
Helco Oct 24, 2024
d2e6b5a
Couple more test cases
Helco Oct 24, 2024
be6b9a6
More secondary asset tests
Helco Oct 28, 2024
7d304b2
Fix apply action not called when Load while loaded asynchronously
Helco Oct 29, 2024
65dd3ad
Improve tests for async apply
Helco Oct 29, 2024
5f9807f
Use TryWrite instead of WriteAsync and lock assets on registry disposal
Helco Oct 29, 2024
c842097
Replace synchronous wait on task with direct exception dispatch
Helco Oct 29, 2024
0c7bb45
Use Assert.Inconclusive instead of Ignore
Helco Oct 29, 2024
7d20a8d
Add low-then-high/sync tests
Helco Oct 30, 2024
cd2fd0d
Fix asset disposal on primary error
Helco Oct 30, 2024
8dd8de1
Add secondary error tests and fix exceptions being swallowed by Task.…
Helco Oct 30, 2024
c079ad4
Now I am become deadlock, the breaker of tests
Helco Oct 30, 2024
b05ca78
Asset.Load is now synchronous.
Helco Oct 31, 2024
66698f4
Unfortunately fix all tests by adding async asset loading
Helco Oct 31, 2024
3fdb2c6
Let the deadlocks surface in the tests instead of crashing the test p…
Helco Nov 4, 2024
abb4de9
ci: Add timeout to test steps
Helco Nov 4, 2024
c89871c
CI should have failed...
Helco Nov 4, 2024
446bb3c
Lost confidence in this approach. Let's try that again
Helco Nov 6, 2024
c4cfff1
Revert "Lost confidence in this approach. Let's try that again"
Helco Nov 6, 2024
267e115
Broke everything in another way with slightly simpler asset locking
Helco Nov 6, 2024
2b99280
Remove STA apartment
Helco Nov 7, 2024
0f01fdf
Fix some problems
Helco Nov 7, 2024
66c1b91
Loosen expected exception type for a couple tests. Not particularly p…
Helco Nov 14, 2024
37648da
Let assets keep an internal reference to all secondary assets
Helco Nov 18, 2024
26a638f
Add SynchronizedTestFixture as workaround for Linux STA
Helco Nov 18, 2024
08480a2
Incremental builds are not working, explicitly do not build ontest af…
Helco Nov 19, 2024
051a4c9
Add reload tests - because they consistently break everything again
Helco Nov 19, 2024
13461c7
Suspiciously a bit more accurate test handling passes (at least on Wi…
Helco Nov 19, 2024
034b3a9
Test and fix asset registry disposal during asset load
Helco Jan 22, 2025
7a2cd9b
Fix some asset errors not being reported as Aggregate in WaitAsyncAll
Helco Jan 22, 2025
1b7b162
Slightly more robust handling of statelock waiting and finalizing the…
Helco Apr 2, 2025
277b1e2
Fix exception type on statelock cancellation in WaitAsyncAll
Helco Apr 2, 2025
39a95ae
Check for invalid state transitions
Helco Apr 2, 2025
e9b053c
Remove unused method
Helco Apr 3, 2025
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
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ csharp_style_prefer_extended_property_pattern = true:suggestion
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent
csharp_style_var_elsewhere = false:silent
dotnet_diagnostic.IDE0008.severity = none
dotnet_diagnostic.IDE0011.severity = none
dotnet_diagnostic.IDE0051.severity = warning
dotnet_diagnostic.IDE0052.severity = warning
dotnet_diagnostic.IDE0064.severity = warning
Expand All @@ -275,6 +277,9 @@ dotnet_diagnostic.IDE0004.severity = warning
dotnet_diagnostic.IDE0005.severity = warning
dotnet_diagnostic.IDE0010.severity = none
dotnet_diagnostic.IDE0016.severity = warning
dotnet_diagnostic.IDE0022.severity = none
dotnet_diagnostic.IDE0023.severity = none
dotnet_diagnostic.IDE0024.severity = none
dotnet_diagnostic.IDE0028.severity = warning
dotnet_diagnostic.IDE0029.severity = warning
dotnet_diagnostic.IDE0030.severity = warning
Expand All @@ -290,8 +295,9 @@ dotnet_diagnostic.IDE0071.severity = warning
dotnet_diagnostic.IDE0082.severity = warning
dotnet_diagnostic.IDE0072.severity = none
dotnet_diagnostic.IDE0120.severity = warning
dotnet_diagnostic.IDE0161.severity = warning
dotnet_diagnostic.IDE0130.severity = none
dotnet_diagnostic.IDE0160.severity = none
dotnet_diagnostic.IDE0161.severity = warning
dotnet_diagnostic.IDE0180.severity = warning
dotnet_diagnostic.IDE0230.severity = warning
dotnet_diagnostic.IDE0270.severity = warning
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ jobs:
- name: Debug Build
run: dotnet build --configuration Debug --no-restore --verbosity normal ${{ inputs.warningsAsErrors && '-warnaserror' || '' }}
- name: Debug Tests
run: dotnet test --configuration Debug --no-restore --verbosity normal
timeout-minutes: 10
run: dotnet test --configuration Debug --no-restore --no-build --verbosity normal -- NUnit.DebugExecution=true NUnit.DebugDiscovery=true
- name: Release Build
run: dotnet build --configuration Release --no-restore --verbosity normal ${{ inputs.warningsAsErrors && '-warnaserror' || '' }}
- name: Release Tests
run: dotnet test --configuration Release --no-restore --verbosity normal
timeout-minutes: 10
run: dotnet test --configuration Release --no-restore --no-build --verbosity normal
38 changes: 38 additions & 0 deletions zzre.core.tests/SynchronizedTestFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Reflection;
using System.Threading;
using NUnit.Framework;

// as workaround to STA not being supported on Linux
// from: https://github.com/nunit/nunit/issues/4110

public abstract class SynchronizedTestFixture
{
private SynchronizationContext? _previousContext;
private SynchronizationContext? _ourContext;

[SetUp]
public void SynchronizedSetup()
{
_previousContext = SynchronizationContext.Current;
_ourContext = CreateNUnitSynchronizationContext();
SynchronizationContext.SetSynchronizationContext(_ourContext);
}

[TearDown]
public void SynchronizedTeardown()
{
SynchronizationContext.SetSynchronizationContext(_previousContext);
}

private static SynchronizationContext CreateNUnitSynchronizationContext()
{
Type type = typeof(Assert).Assembly.GetType("NUnit.Framework.Internal.SingleThreadedTestSynchronizationContext")!;

return (SynchronizationContext)Activator.CreateInstance(type,
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance,
null,
[new TimeSpan(TimeSpan.TicksPerSecond)],
null)!;
}
}
Loading
Loading