-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adaptations to switch from undertow to armeria http server and …
…related changes in evitaDB project
- Loading branch information
tpz
committed
Aug 6, 2024
1 parent
c9b941f
commit 2bc1ca1
Showing
9 changed files
with
87 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Net; | ||
using System.Net.Http.Headers; | ||
using DotNet.Testcontainers.Configurations; | ||
using DotNet.Testcontainers.Containers; | ||
|
||
namespace EvitaDB.Test.Utils; | ||
|
||
public class CustomWaitStrategy : IWaitUntil | ||
{ | ||
public async Task<bool> UntilAsync(IContainer container) | ||
{ | ||
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); | ||
var httpClient = new HttpClient() | ||
{ | ||
Timeout = TimeSpan.FromSeconds(5) | ||
}; | ||
while (true) | ||
{ | ||
try | ||
{ | ||
var message = | ||
new HttpRequestMessage(HttpMethod.Get, | ||
$"http://{container.Hostname}:{container.GetMappedPublicPort(5555)}/system/server-name") | ||
{ | ||
Version = new Version(2, 0), | ||
Headers = | ||
{ | ||
Accept = { MediaTypeWithQualityHeaderValue.Parse("application/json") }, | ||
UserAgent = { ProductInfoHeaderValue.Parse("EvitaDB.Test") } | ||
} | ||
}; | ||
await httpClient.SendAsync(message); | ||
return true; | ||
} | ||
catch (Exception) | ||
{ | ||
// wait | ||
} | ||
} | ||
} | ||
} |