Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cnkz committed Jan 9, 2024
1 parent 307b351 commit f6605c9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,9 @@ jobs:
dotnet test --no-build
--configuration ${{matrix.configuration}}
--verbosity normal
--blame --blame-crash
--blame-crash
--results-directory "TestResults-${{ matrix.configuration}}-${{ matrix.dotnet-version }}"
src/ManagedObjectSize.Tests/ManagedObjectSize.Tests.csproj
# - name: Upload dotnet test results
# uses: actions/upload-artifact@v3
# with:
# name: dotnet-testoutput-${{ matrix.configuration}}-${{ matrix.dotnet-version }}
# path: TestOutput-${{ matrix.configuration}}-${{ matrix.dotnet-version }}
# # Use always() to always run this step to publish test results when there are test failures
# if: ${{ always() }}
- name: Upload dotnet test results
uses: actions/upload-artifact@v3
with:
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,26 @@ jobs:
- name: Build
run: dotnet build --no-restore --configuration ${{matrix.configuration}} src/ManagedObjectSize.sln
- name: Test
run: dotnet test --no-build --configuration ${{matrix.configuration}} --verbosity normal src/ManagedObjectSize.Tests/ManagedObjectSize.Tests.csproj
run: >
dotnet test --no-build
--configuration ${{matrix.configuration}}
--verbosity normal
--blame-crash
--results-directory "TestResults-${{ matrix.configuration}}-${{ matrix.dotnet-version }}"
src/ManagedObjectSize.Tests/ManagedObjectSize.Tests.csproj
- name: Upload dotnet test results
uses: actions/upload-artifact@v3
with:
name: dotnet-testresults-${{ matrix.configuration}}-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.configuration}}-${{ matrix.dotnet-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

- if: ${{ matrix.dotnet-version == '8.0.x' && matrix.configuration == 'Release' }}
name: Publish
run: dotnet nuget push **/*.nupkg -k ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
run: >
dotnet nuget push **/*.nupkg
-k ${{secrets.NUGET_API_KEY}}
--source https://api.nuget.org/v3/index.json
--skip-duplicate
--no-symbols
14 changes: 3 additions & 11 deletions src/ManagedObjectSize.Tests/ObjectSizeTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System.Diagnostics;
using ManagedObjectSize.ObjectPool;
using Microsoft.Diagnostics.Runtime;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using ManagedObjectSize.ObjectPool;
using ManagedObjectSize.Pooling;
using Microsoft.Diagnostics.Runtime;
using Microsoft.Extensions.ObjectPool;

namespace ManagedObjectSize.Tests
{
Expand Down Expand Up @@ -252,11 +249,6 @@ static object CreateData(bool equal, int count)
[DataRow(true, false)]
public unsafe void ObjectSize_ReportsCorrectSize(bool useRtHelpers, bool useObjectPool)
{
if (useRtHelpers && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var data = new Dictionary<ulong, (string Name, Type Type, long Count, long ExclusiveSize, long InclusiveSize)>();

// References are on stack and won't be moved by GC.
Expand Down Expand Up @@ -317,7 +309,7 @@ public unsafe void ObjectSize_ReportsCorrectSize(bool useRtHelpers, bool useObje

// We require the addresses of the test objects to not change. We determine the address during GetSize()
// and need it to stay the same until we have created a memory snapshot.
if (!GC.TryStartNoGCRegion(100_000_000))
if (!GC.TryStartNoGCRegion(500_000_000))
{
throw new InvalidOperationException("Failed to start no GC region");
}
Expand Down

0 comments on commit f6605c9

Please sign in to comment.