You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by co...@apache.org on 2026/05/20 22:12:09 UTC
(tinkerpop) branch fixFlakyTests created (now da3612c7ee)
This is an automated email from the ASF dual-hosted git repository.
Cole-Greer pushed a change to branch fixFlakyTests
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
at da3612c7ee Serialize .NET integration tests that share the Gremlin Server graph
This branch includes the following new commits:
new 215b707f22 Fix flaky transaction integration tests
new da3612c7ee Serialize .NET integration tests that share the Gremlin Server graph
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(tinkerpop) 01/02: Fix flaky transaction integration tests
Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
Cole-Greer pushed a commit to branch fixFlakyTests
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 215b707f2246ff7033d4ad0f048a77f32a49be43
Author: Cole Greer <co...@colegreer.ca>
AuthorDate: Wed May 20 14:51:50 2026 -0700
Fix flaky transaction integration tests
shouldTrackTransactionCountAccurately was racing because commitTx()
and rollbackTx() returned without consuming the HTTP response. With
chunked transfer encoding, the client can receive response headers
before the server completes transactionManager.destroy(). Wrapping
in try-with-resources ensures the full response is read, guaranteeing
server-side processing is complete before asserting the count.
shouldTimeoutIdleTransactionWithNoOperations used a 1ms timeout,
which could expire during the beginTx() HTTP round-trip itself,
causing getFirstHeader(TRANSACTION_ID) to return null and NPE.
Increased to 500ms — still well below the 1000ms sleep that
validates timeout behavior.
---
.../server/GremlinServerHttpTransactionIntegrateTest.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpTransactionIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpTransactionIntegrateTest.java
index dd61bfa1cc..ce21743c50 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpTransactionIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpTransactionIntegrateTest.java
@@ -96,7 +96,7 @@ public class GremlinServerHttpTransactionIntegrateTest extends AbstractGremlinSe
settings.transactionTimeout = 1000;
break;
case "shouldTimeoutIdleTransactionWithNoOperations":
- settings.transactionTimeout = 1;
+ settings.transactionTimeout = 500;
break;
case "shouldTimeoutAndRejectLateCommit":
case "shouldTrackTransactionCountAccurately":
@@ -333,7 +333,7 @@ public class GremlinServerHttpTransactionIntegrateTest extends AbstractGremlinSe
public void shouldTimeoutIdleTransactionWithNoOperations() throws Exception {
final String txId = beginTx(client, GTX);
- // wait for the transaction to timeout (configured at 1ms)
+ // wait for the transaction to timeout (configured at 500ms)
Thread.sleep(1000);
// the transaction should be gone
@@ -382,12 +382,16 @@ public class GremlinServerHttpTransactionIntegrateTest extends AbstractGremlinSe
assertEquals(3, txManager.getActiveTransactionCount());
- // commit one
- commitTx(client, txId1, GTX);
+ // commit one - must close response to ensure server-side processing completes
+ try (final CloseableHttpResponse r = commitTx(client, txId1, GTX)) {
+ assertEquals(200, r.getStatusLine().getStatusCode());
+ }
assertEquals(2, txManager.getActiveTransactionCount());
// rollback one
- rollbackTx(client, txId2, GTX);
+ try (final CloseableHttpResponse r = rollbackTx(client, txId2, GTX)) {
+ assertEquals(200, r.getStatusLine().getStatusCode());
+ }
assertEquals(1, txManager.getActiveTransactionCount());
// let the third one timeout
(tinkerpop) 02/02: Serialize .NET integration tests that share the Gremlin Server graph
Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
Cole-Greer pushed a commit to branch fixFlakyTests
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit da3612c7eeafdec94927c372f1b28041ad83b876
Author: Cole Greer <co...@colegreer.ca>
AuthorDate: Wed May 20 15:11:14 2026 -0700
Serialize .NET integration tests that share the Gremlin Server graph
PropertyDeserializationTests and GraphTraversalTests were running
concurrently with @GraphComputerOnly Gherkin scenarios. During OLAP
computation, TinkerGraphComputer sets a graphComputerView on the
shared TinkerGraph instance. Any concurrent read through TinkerVertex
sees compute properties (like haltedTraversers) merged with real
properties, causing spurious assertion failures and NPEs.
Place all tests that hit the shared server into a single non-parallel
xUnit collection (GremlinServerTests) so they never overlap with an
active GraphComputer view.
---
.../Driver/PropertyDeserializationTests.cs | 5 +++++
.../test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs | 6 +++---
.../Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs | 1 +
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/PropertyDeserializationTests.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/PropertyDeserializationTests.cs
index 01cd0b266c..f7c41bdded 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/PropertyDeserializationTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/PropertyDeserializationTests.cs
@@ -35,6 +35,11 @@ using Xunit;
namespace Gremlin.Net.IntegrationTest.Driver
{
+ /// <summary>
+ /// Serialized with Gherkin tests to avoid reading vertices through an active GraphComputerView
+ /// when @GraphComputerOnly scenarios run concurrently, which would expose transient compute properties.
+ /// </summary>
+ [Collection("GremlinServerTests")]
public class PropertyDeserializationTests
{
private readonly RemoteConnectionFactory _connectionFactory = new();
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
index dd8f32fbca..fae10dafd8 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
@@ -37,10 +37,10 @@ using Xunit.Abstractions;
namespace Gremlin.Net.IntegrationTest.Gherkin
{
- [CollectionDefinition(nameof(GherkinTestDefinition), DisableParallelization = true)]
- public class GherkinTestDefinition { }
+ [CollectionDefinition(nameof(GremlinServerTests), DisableParallelization = true)]
+ public class GremlinServerTests { }
- [Collection(nameof(GherkinTestDefinition))]
+ [Collection(nameof(GremlinServerTests))]
public class GherkinTestRunner
{
private static readonly IDictionary<string, IgnoreReason> IgnoredScenarios =
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
index 718e0fbe84..489994b4c0 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
@@ -34,6 +34,7 @@ using Gremlin.Net.Process.Traversal.Strategy.Decoration;
namespace Gremlin.Net.IntegrationTest.Process.Traversal.DriverRemoteConnection
{
+ [Collection("GremlinServerTests")]
public class GraphTraversalTests
{
private readonly RemoteConnectionFactory _connectionFactory = new RemoteConnectionFactory();