Skip to content

Commit ab26f0c

Browse files
fix tests
1 parent 71cc234 commit ab26f0c

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/IpcSample.ConsoleClient/Client.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private static async Task RunTestsAsync(CancellationToken cancellationToken)
6666
Console.WriteLine($"[TEST 3] sum of 3 complexe number is: {result3.A}+{result3.B}i", cancellationToken);
6767

6868
// test 4: call IPC service method without parameter or return
69-
await systemClient.DoNothing(cancellationToken);
69+
await systemClient.FireAndForget(cancellationToken);
7070
Console.WriteLine($"[TEST 4] invoked DoNothing()");
7171
//((IDisposable)systemClient).Dispose();
7272

src/UiPath.CoreIpc.Tests/Implementation/SystemService.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace UiPath.Ipc.Tests;
88

99
public interface ISystemService
1010
{
11-
Task DoNothing(CancellationToken cancellationToken = default);
11+
Task FireAndForget(CancellationToken cancellationToken = default);
1212
Task VoidThreadName(CancellationToken cancellationToken = default);
1313
Task VoidSyncThrow(CancellationToken cancellationToken = default);
1414
Task<string> GetThreadName(CancellationToken cancellationToken = default);
@@ -75,18 +75,18 @@ public async Task<string> SendMessage(SystemMessage message, CancellationToken c
7575
return returnValue;
7676
}
7777

78-
public bool DidNothing { get; set; }
78+
public bool FireAndForgetDone { get; set; }
7979

80-
public async Task DoNothing(CancellationToken cancellationToken = default)
80+
public async Task FireAndForget(CancellationToken cancellationToken = default)
8181
{
8282
const int Timeout =
8383
#if CI
84-
100;
84+
400;
8585
#else
86-
10;
86+
40;
8787
#endif
8888
await Task.Delay(Timeout);
89-
DidNothing = true;
89+
FireAndForgetDone = true;
9090
}
9191

9292
public async Task<Guid> GetGuid(Guid guid, CancellationToken cancellationToken = default)

src/UiPath.CoreIpc.Tests/NamedPipeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public async Task PipeSecurityForWindows()
3737
.AddEndpoint<ISystemService>()
3838
.ValidateAndBuild();
3939
_ = protectedService.RunAsync();
40-
await CreateSystemService().DoNothing().ShouldThrowAsync<UnauthorizedAccessException>();
40+
await CreateSystemService().FireAndForget().ShouldThrowAsync<UnauthorizedAccessException>();
4141
}
4242

4343
[Theory]
4444
[InlineData(new int[0])]
4545
[InlineData(100)]
4646
[InlineData(1100)]
47-
[InlineData(10, 10, 10, 10)]
47+
[InlineData(100, 100)]
4848
public async Task PipeCancelIoOnServer_AnyNoOfTimes(params int[] msDelays)
4949
{
5050
bool cancelIoResult = false;

src/UiPath.CoreIpc.Tests/SystemTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ public async Task ServerTimeout()
5555
[Fact]
5656
public async Task Void()
5757
{
58-
_systemService.DidNothing = false;
59-
await _systemClient.DoNothing();
60-
_systemService.DidNothing.ShouldBeFalse();
61-
while (!_systemService.DidNothing)
58+
_systemService.FireAndForgetDone = false;
59+
await _systemClient.FireAndForget();
60+
_systemService.FireAndForgetDone.ShouldBeFalse();
61+
while (!_systemService.FireAndForgetDone)
6262
{
6363
await Task.Delay(10);
6464
Trace.WriteLine(this + " Void");
@@ -202,26 +202,26 @@ public async Task BeforeCall()
202202
var proxy = SystemClientBuilder().BeforeCall(async (c, _) =>
203203
{
204204
newConnection = c.NewConnection;
205-
c.Method.ShouldBe(typeof(ISystemService).GetMethod(nameof(ISystemService.DoNothing)));
205+
c.Method.ShouldBe(typeof(ISystemService).GetMethod(nameof(ISystemService.FireAndForget)));
206206
c.Arguments.Single().ShouldBe(""); // cancellation token
207207
}).ValidateAndBuild();
208208
newConnection.ShouldBeFalse();
209209

210-
await proxy.DoNothing();
210+
await proxy.FireAndForget();
211211
newConnection.ShouldBeTrue();
212212

213-
await proxy.DoNothing();
213+
await proxy.FireAndForget();
214214
newConnection.ShouldBeFalse();
215215
var ipcProxy = (IpcProxy)proxy;
216216
var closed = false;
217217
ipcProxy.Connection.Closed += delegate { closed = true; };
218218
ipcProxy.CloseConnection();
219219
closed.ShouldBeTrue();
220220
newConnection.ShouldBeFalse();
221-
await proxy.DoNothing();
221+
await proxy.FireAndForget();
222222
newConnection.ShouldBeTrue();
223223

224-
await proxy.DoNothing();
224+
await proxy.FireAndForget();
225225
newConnection.ShouldBeFalse();
226226
ipcProxy.CloseConnection();
227227
}

0 commit comments

Comments
 (0)