Skip to content

Simplify and reuse code around temp dirs in FSharp.Compiler.Service.Tests #18046

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

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

majocha
Copy link
Contributor

@majocha majocha commented Nov 22, 2024

Description

TestFramework module from Test.Utilities provides functionality for creating and cleanup of temp directories and files for testing.
There is a lot of similar code in FSharp.Compiler.Service.Tests that can be simplified now.

Fixes

Some flakiness around creating deleting / directories, for example:
https://dev.azure.com/dnceng-public/public/_build/results?buildId=875794&view=logs&j=170942dc-5349-5022-2275-77744f335216&t=20776a93-33c2-52f0-ee8f-b8c9809b2e23&l=16230

  Failed FSharp.Compiler.Service.Tests.ExprTests.Test Operator Declarations for IntPtr [5 ms]
  Error Message:
   System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\Users\cloudtest\AppData\Local\Temp\FSharp.Test.Utilities\ab3ae841\ExprTests\92147ee0_8116_18.fs'.

Copy link
Contributor

✅ No release notes required

@majocha majocha marked this pull request as ready for review November 22, 2024 09:24
@majocha majocha requested a review from a team as a code owner November 22, 2024 09:24
Copy link
Contributor

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, thanks for taking care of this. I never have the energy to work on it, so I really appreciate this work.

@majocha
Copy link
Contributor Author

majocha commented Nov 25, 2024

Thanks! Doing this is my procrastination 😄 so I'm happy it's useful and pushes things a bit in the right direction.

Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff. Eliminating primitive types from code is the right spirit and has proliferating benefits. Thanks for this :)

@psfinaki psfinaki merged commit 30d9ea7 into dotnet:main Nov 25, 2024
33 checks passed
psfinaki added a commit that referenced this pull request Nov 28, 2024
* Add -sign to build.sh (#18024)

* Fix singing problems (#18040)

* Skip flaky test (#18051)

* Remove support for `System.AggressiveAttributeTrimming` feature switch. (#18039)

Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>
Co-authored-by: Petr <psfinaki@users.noreply.github.com>

* Update some internal guidelines (#18052)

* simplify temp dirs in service (#18046)

Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>

* Add Contributing.md (#18043)

* contributing

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>

* Update CONTRIBUTING.md

Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>

* Update CONTRIBUTING.md

Co-authored-by: Petr <psfinaki@users.noreply.github.com>

* Update CONTRIBUTING.md

---------

Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Petr <psfinaki@users.noreply.github.com>

* [main] Update dependencies from dotnet/arcade (#17729)

* Update dependencies from https://github.com/dotnet/arcade build 20240913.2

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24462.3 -> To Version 9.0.0-beta.24463.2

* Update dependencies from https://github.com/dotnet/arcade build 20240916.2

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24463.2 -> To Version 9.0.0-beta.24466.2

* Update dependencies from https://github.com/dotnet/arcade build 20240923.1

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24466.2 -> To Version 9.0.0-beta.24473.1

* Update dependencies from https://github.com/dotnet/arcade build 20241001.3

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24473.1 -> To Version 9.0.0-beta.24501.3

* Update dependencies from https://github.com/dotnet/arcade build 20241003.2

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24501.3 -> To Version 9.0.0-beta.24503.2

* Update dependencies from https://github.com/dotnet/arcade build 20241008.3

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24503.2 -> To Version 9.0.0-beta.24508.3

* Update dependencies from https://github.com/dotnet/arcade build 20241009.3

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24508.3 -> To Version 9.0.0-beta.24509.3

* Update dependencies from https://github.com/dotnet/arcade build 20241016.2

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24509.3 -> To Version 9.0.0-beta.24516.2

* Update dependencies from https://github.com/dotnet/arcade build 20241112.13

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24462.3 -> To Version 9.0.0-beta.24562.13

* Update dependencies from https://github.com/dotnet/arcade build 20241122.2

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24462.3 -> To Version 9.0.0-beta.24572.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>

* Refactor AsyncMemoize, introduce AsyncLazy (#18002)

* refactor AsyncMemoize, introduce AsyncLazy

* use lock free mb in tests

* remove unnecessary prop

* update il baselines

* rename

* add requestCount name

Co-authored-by: Petr Pokorny <petr@innit.cz>

* improve as reviewed

* lock for TryGet

* more locks

* ilverify

* deallocate computation when completed

* ilverify

* style

* typo

---------

Co-authored-by: Petr Pokorny <petr@innit.cz>

* Fix crashdump paths in CI (#18065)

* Various updates to ILVerify (#18060)

* Update azure-pipelines-PR.yml

* Add null annotation to Async.SwitchToContext (#18059)

---------

Co-authored-by: Ella Hathaway <67609881+ellahathaway@users.noreply.github.com>
Co-authored-by: Petr <psfinaki@users.noreply.github.com>
Co-authored-by: Petr Pokorny <petrpokorny@microsoft.com>
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>
Co-authored-by: Jakub Majocha <1760221+majocha@users.noreply.github.com>
Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Petr Pokorny <petr@innit.cz>
Co-authored-by: Ch13 <boundedchenn31@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants