-
Notifications
You must be signed in to change notification settings - Fork 574
Fix for OSS pipelines transient failures #5275
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
Conversation
…ion failures and add warmup checks
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
… initialization failures
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…lone HttpRequestMessage for retries
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/RetryAuthenticationHttpMessageHandler.cs
Fixed
Show fixed
Hide fixed
| catch | ||
| { | ||
| // If we can't parse the token, assume a short expiration | ||
| _tokenExpiration = DateTime.UtcNow.AddMinutes(30); | ||
| } |
Check notice
Code scanning / CodeQL
Generic catch clause Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 18 days ago
To fix the problem, replace the generic catch clause in the GetBearerTokenAsync method's token parsing logic with catch clauses for specific exceptions that can actually be thrown by JwtSecurityTokenHandler.ReadJwtToken. According to Microsoft documentation and typical usage, possible exceptions include ArgumentException (invalid token argument), SecurityTokenException (token format issues), and possibly FormatException (malformed token string). Therefore, change the generic catch on line 57 to:
catch (ArgumentException)
catch (SecurityTokenException)
catch (FormatException)The catch body remains unchanged, as the fallback behavior (setting expiration to 30 minutes from now) is still desired in these cases. Ensure that Microsoft.IdentityModel.Tokens is properly imported for SecurityTokenException (but do not add imports outside demonstrated code regions). No other functionality should be changed.
-
Copy modified line R57 -
Copy modified lines R62-R71
| @@ -54,11 +54,21 @@ | ||
| var jwtToken = handler.ReadJwtToken(token); | ||
| _tokenExpiration = jwtToken.ValidTo; | ||
| } | ||
| catch | ||
| catch (ArgumentException) | ||
| { | ||
| // If we can't parse the token, assume a short expiration | ||
| _tokenExpiration = DateTime.UtcNow.AddMinutes(30); | ||
| } | ||
| catch (System.IdentityModel.Tokens.Jwt.SecurityTokenException) | ||
| { | ||
| // If we can't parse the token, assume a short expiration | ||
| _tokenExpiration = DateTime.UtcNow.AddMinutes(30); | ||
| } | ||
| catch (FormatException) | ||
| { | ||
| // If we can't parse the token, assume a short expiration | ||
| _tokenExpiration = DateTime.UtcNow.AddMinutes(30); | ||
| } | ||
| } | ||
|
|
||
| return token; |
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/TestFhirServerFactory.cs
Dismissed
Show dismissed
Hide dismissed
…res in E2E and integration tests
…or Stu3, R4, R4B, and R5
…rchParameterOptimisticConcurrencyIntegrationTests
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/RetryableCredentialProvider.cs
Fixed
Show fixed
Hide fixed
…nt failures in E2E and integration tests" This reverts commit 8879a39.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Description
This pull request refactors the CI pipeline to separate CosmosDB and SQL Server integration tests for each FHIR version (Stu3, R4, R4B, R5), introduces dedicated job templates for CosmosDB and SQL Server tests, and improves pipeline robustness by adding retry logic to key tasks. It also enhances the health check process with configurable timeout and success criteria.
Pipeline structure and job separation:
build/ci-pipeline.ymlto run CosmosDB and SQL Server integration tests separately for each FHIR version, using new templates (run-cosmos-tests.ymlandrun-sql-tests.yml). This enables more granular control and reporting for each data store and version. [1] [2] [3] [4] [5] [6]build/jobs/run-cosmos-tests.ymltemplate for CosmosDB integration and E2E tests, and renamedrun-tests.ymltorun-sql-tests.ymlfor SQL Server integration tests. The CosmosDB and SQL Server jobs are now fully separated. [1] [2] [3] [4]Pipeline robustness and reliability:
retryCountOnTaskFailure: 1to criticalDotNetCoreCLI,AzurePowerShell, and test tasks across build, test, and deployment jobs to improve resilience against transient failures. [1] [2] [3] [4] [5] [6] [7] [8] [9]Health check improvements:
provision-healthcheck.ymlscript to support configurable timeout and required consecutive successes before passing, providing more robust validation of service health before proceeding.These changes collectively improve test isolation, reporting, and reliability of the CI pipeline for all supported FHIR versions and data stores.
Related issues
Addresses AB#166378.
Testing
Describe how this change was tested.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)