Skip to content
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
31 changes: 0 additions & 31 deletions test/integration/core/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,36 +170,5 @@ describe("transactions", () => {
await checkRecordCountByIdInAnotherTransaction(9, 1);
await checkRecordCountByIdInAnotherTransaction(10, 1);
});

it("should not allow concurrent write transactions", async () => {
const firebolt = Firebolt();
const connection1 = await firebolt.connect(connectionParams);
const connection2 = await firebolt.connect(connectionParams);

// Start first transaction with a write operation
await connection1.begin();
await connection1.execute("INSERT INTO transaction_test VALUES (11, 'first')");

// Attempt to start a second concurrent write transaction
// Core does not support multiple concurrent write transactions, so this should fail
// The error may occur when trying to begin() or when trying to execute the write operation
let secondTransactionFailed = false;
try {
await connection2.begin();
await connection2.execute("INSERT INTO transaction_test VALUES (12, 'second')");
} catch (error) {
secondTransactionFailed = true;
// Verify that the second transaction did not succeed
await checkRecordCountByIdInAnotherTransaction(12, 0);
}

expect(secondTransactionFailed).toBe(true);

// Clean up: rollback the first transaction
await connection1.rollback();

// Verify the first transaction's data was rolled back
await checkRecordCountByIdInAnotherTransaction(11, 0);
});
});

5 changes: 3 additions & 2 deletions test/integration/v2/performance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ describe("performance comparison", () => {
expect(result.normalTime).toBeGreaterThan(0);
expect(result.streamTime).toBeGreaterThan(0);

// Ensure streaming is not more than 10% slower than normal execution for each dataset size
const maxAllowedStreamTime = result.normalTime * 1.1; // 10% slower threshold
// Ensure streaming is not more than 30% slower than normal execution for each dataset size
// Note: Threshold increased from 10% to 30% due to test flakiness in performance comparisons
const maxAllowedStreamTime = result.normalTime * 1.3; // 30% slower threshold
expect(result.streamTime).toBeLessThanOrEqual(maxAllowedStreamTime);
}
});
Expand Down