From fbc4f0b84fee2a075ed7e4021f8805fbb54ddfb2 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 10 Sep 2025 09:03:11 +0200 Subject: [PATCH] C#: Increase attempts to reach nuget.org in integration tests to reduce flakiness. --- .../all-platforms/standalone_resx/test.py | 4 ++++ .../all-platforms/standalone_winforms/test.py | 7 +++++++ .../standalone_dependencies_nuget_config_error/test.py | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/csharp/ql/integration-tests/all-platforms/standalone_resx/test.py b/csharp/ql/integration-tests/all-platforms/standalone_resx/test.py index ef1399f4cb28..d799c830dd94 100644 --- a/csharp/ql/integration-tests/all-platforms/standalone_resx/test.py +++ b/csharp/ql/integration-tests/all-platforms/standalone_resx/test.py @@ -2,5 +2,9 @@ def test(codeql, csharp): + # Making sure the reachability test of `nuget.org` succeeds: + os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_TIMEOUT"] = "1000" + os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_LIMIT"] = "5" + os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_EXTRACT_RESOURCES"] = "true" codeql.database.create(build_mode="none") diff --git a/csharp/ql/integration-tests/all-platforms/standalone_winforms/test.py b/csharp/ql/integration-tests/all-platforms/standalone_winforms/test.py index 237174a46c6b..c4f98dd36290 100644 --- a/csharp/ql/integration-tests/all-platforms/standalone_winforms/test.py +++ b/csharp/ql/integration-tests/all-platforms/standalone_winforms/test.py @@ -1,2 +1,9 @@ +import os + + def test(codeql, csharp): + # Making sure the reachability test of `nuget.org` succeeds: + os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_TIMEOUT"] = "1000" + os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_LIMIT"] = "5" + codeql.database.create(build_mode="none") diff --git a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error/test.py b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error/test.py index 5aaafca6a46a..42405ca54d4e 100644 --- a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error/test.py +++ b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error/test.py @@ -1,6 +1,11 @@ +import os import runs_on @runs_on.posix def test(codeql, csharp): + # Making sure the reachability test of `nuget.org` succeeds: + os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_TIMEOUT"] = "1000" + os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_LIMIT"] = "5" + codeql.database.create(build_mode="none")