Skip to content

Commit ebd507e

Browse files
committed
- fix broken tests
1 parent 079136f commit ebd507e

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

.github/workflows/Master-Build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ name: master-build
66
on:
77
push:
88
branches: [ "master" ]
9-
paths-ignore:
10-
- "**/*.md"
11-
- "**/*.gitignore"
12-
- "**/*.gitattributes"
9+
paths-ignore:
10+
- "**/*.md"
11+
- "**/*.gitignore"
12+
- "**/*.gitattributes"
1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest

.github/workflows/Release-CI.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,23 @@ jobs:
142142
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
143143
working-directory: '${{ env.working-directory }}'
144144

145-
- name: Step-09 Test Solution
145+
- name: Step-09 Run Unit Tests
146146
run: |
147-
# Run only unit tests, exclude integration tests that require LocalStack/Docker
148-
# Integration tests are in Integration folders/namespaces and may cause CI timeouts
149-
# Also exclude Security tests which require IAM/LocalStack services
150-
dotnet test --configuration Release --no-build --no-restore --verbosity normal --filter "FullyQualifiedName!~Integration&FullyQualifiedName!~Security"
147+
dotnet test --configuration Release --no-build --no-restore --verbosity normal \
148+
--filter "FullyQualifiedName!~Integration&FullyQualifiedName!~Security"
151149
working-directory: '${{ env.working-directory }}'
152150

151+
- name: Step-09b Run Integration Tests with LocalStack
152+
run: |
153+
dotnet test --configuration Release --no-build --no-restore --verbosity normal \
154+
--filter "Category=Integration&Category=RequiresLocalStack"
155+
working-directory: '${{ env.working-directory }}'
156+
env:
157+
AWS_ACCESS_KEY_ID: test
158+
AWS_SECRET_ACCESS_KEY: test
159+
AWS_DEFAULT_REGION: us-east-1
160+
AWS_ENDPOINT_URL: http://localhost:4566
161+
153162
- name: Step-10 Create NuGet Package (Pre-release)
154163
if: ${{ env.is-release != 'true' }}
155164
run: dotnet pack --configuration Release --no-build --output ./packages -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}

src/SourceFlow/Cloud/Resilience/CircuitBreaker.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,17 @@ public async Task<T> ExecuteAsync<T>(Func<Task<T>> operation, CancellationToken
7676
{
7777
cts.CancelAfter(_options.OperationTimeout);
7878

79-
var operationTask = operation();
79+
Task<T> operationTask;
80+
try
81+
{
82+
operationTask = operation();
83+
}
84+
catch (Exception ex) when (!cancellationToken.IsCancellationRequested)
85+
{
86+
OnFailure(ex);
87+
throw;
88+
}
89+
8090
var timeoutTask = Task.Delay(Timeout.InfiniteTimeSpan, cts.Token);
8191

8292
var completed = await Task.WhenAny(operationTask, timeoutTask);

0 commit comments

Comments
 (0)