Skip to content
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

fix(perf-tests): Initial perf tests had artificially high P99 #229

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Fauna.Test/Performance/utils"]
path = Fauna.Test/Performance/utils
url = https://github.com/fauna/driver-perf-utils.git
8 changes: 4 additions & 4 deletions Fauna.Test/Fauna.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<PackageReference Include="Polly" Version="8.3.0" />
</ItemGroup>
<ItemGroup>
<Content Include="Performance/setup/*">
<Content Include="Performance/utils/*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>setup/%(Filename)%(Extension)</Link>
<Link>utils/%(Filename)%(Extension)</Link>
</Content>
<Content Include="Performance/setup/fauna/*">
<Content Include="Performance/utils/fauna/*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>setup/fauna/%(Filename)%(Extension)</Link>
<Link>utils/fauna/%(Filename)%(Extension)</Link>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions Fauna.Test/Performance/Performance.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public void BeforeAll()
var endpoint = Environment.GetEnvironmentVariable("FAUNA_ENDPOINT") ?? "http://localhost:8443";

_client = GetTestClient(secret, endpoint, true);

// Make initial query to establish connection before running perf
var _ = _client.QueryAsync(FQL($"null")).Result;
}

[SetUp]
Expand Down
2 changes: 1 addition & 1 deletion Fauna.Test/Performance/TestDataParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal static class TestDataParser
/// <returns>An IEnumerable<TestCaseData> that iterates over test scenarios</returns>
public static IEnumerable<TestCaseData> GetQueriesFromFile()
{
var contents = File.ReadAllText("./setup/queries.json");
var contents = File.ReadAllText("./utils/queries.json");
var jsonRoot = JsonSerializer.Deserialize<TestQueries>(contents);

foreach (var query in jsonRoot!.Queries)
Expand Down
22 changes: 0 additions & 22 deletions Fauna.Test/Performance/setup/fauna/main.fsl

This file was deleted.

11 changes: 0 additions & 11 deletions Fauna.Test/Performance/setup/fauna/seeddata.fql

This file was deleted.

12 changes: 0 additions & 12 deletions Fauna.Test/Performance/setup/init.sh

This file was deleted.

86 changes: 0 additions & 86 deletions Fauna.Test/Performance/setup/queries.json

This file was deleted.

7 changes: 0 additions & 7 deletions Fauna.Test/Performance/setup/teardown.sh

This file was deleted.

1 change: 1 addition & 0 deletions Fauna.Test/Performance/utils
Submodule utils added at c48335
3 changes: 1 addition & 2 deletions Fauna/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Threading;
using Fauna.Core;
using Fauna.Core;
using Fauna.Util;
using Microsoft.Extensions.Logging;

Expand Down
2 changes: 1 addition & 1 deletion concourse/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ resources:
- name: dev-tests-trigger
type: time
source:
interval: 6h
interval: 24h

jobs:
- name: set-self
Expand Down
6 changes: 3 additions & 3 deletions concourse/scripts/perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export LOG_UNIQUE=$(date +%s%3N)
# Install fauna-shell
apt update -qq
apt install -y -qq npm
npm install --silent -g fauna-shell@^2.0.0
npm install --silent -g fauna-shell@^3.0.0

cd repo.git

# Run init.sh to setup database schema and initial data
pushd Fauna.Test/Performance/setup
pushd Fauna.Test/Performance/utils
./init.sh

# Build solution and run performance tests
Expand All @@ -32,5 +32,5 @@ echo '```' >> ../slack-message/perf-stats
echo "_<$CONCOURSE_URL|Concourse job>_" >> ../slack-message/perf-stats

# Run teardown.sh to delete the test collections
pushd Fauna.Test/Performance/setup
pushd Fauna.Test/Performance/utils
./teardown.sh
Loading