Skip to content

Commit 7dacf75

Browse files
committed
FIXED failing E2E tests
1 parent 27ea5d0 commit 7dacf75

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
- `getDocument` no longer emits `EVENT_CACHE_PURGE_FAILURE` when the cache is unavailable for a read. It now correctly emits `EVENT_CACHE_READ_FAILURE`, so callers that distinguish the two events receive the right signal.
2222
- A broken or unavailable cache can no longer cause `updateDocument` or `deleteDocument` to surface an exception to the caller. Both operations are now fully fail-open with respect to the cache layer.
2323
- A throwing `EVENT_CACHE_PURGE_FAILURE` or `EVENT_CACHE_READ_FAILURE` listener can no longer abort an in-progress database operation.
24+
- Fixed 6 `MariaDBTest` E2E tests that failed with `Incorrect table name` due to collection IDs derived from long method names exceeding MariaDB's 64-character identifier limit.
2425

2526
[Unreleased]: https://github.com/utopia-php/database/compare/6.0.0...HEAD
2627
[6.0.0]: https://github.com/utopia-php/database/compare/5.3.17...6.0.0

tests/e2e/Adapter/MariaDBTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function seedCacheFailOpenCollection(string $collection): Database
127127

128128
public function testCacheFailOpenOnRead(): void
129129
{
130-
$collection = __FUNCTION__;
130+
$collection = substr(__FUNCTION__, 4, 34);
131131
$database = $this->seedCacheFailOpenCollection($collection);
132132
$originalCache = $database->getCache();
133133

@@ -146,7 +146,7 @@ public function testCacheFailOpenOnRead(): void
146146

147147
public function testCacheFailOpenOnCreate(): void
148148
{
149-
$collection = __FUNCTION__;
149+
$collection = substr(__FUNCTION__, 4, 34);
150150
$database = $this->seedCacheFailOpenCollection($collection);
151151
$originalCache = $database->getCache();
152152

@@ -168,7 +168,7 @@ public function testCacheFailOpenOnCreate(): void
168168

169169
public function testCacheFailOpenOnUpdate(): void
170170
{
171-
$collection = __FUNCTION__;
171+
$collection = substr(__FUNCTION__, 4, 34);
172172
$database = $this->seedCacheFailOpenCollection($collection);
173173
$originalCache = $database->getCache();
174174

@@ -189,7 +189,7 @@ public function testCacheFailOpenOnUpdate(): void
189189

190190
public function testCacheFailOpenOnDelete(): void
191191
{
192-
$collection = __FUNCTION__;
192+
$collection = substr(__FUNCTION__, 4, 34);
193193
$database = $this->seedCacheFailOpenCollection($collection);
194194
$originalCache = $database->getCache();
195195

@@ -213,7 +213,7 @@ public function testCacheFailOpenOnDelete(): void
213213

214214
public function testCacheFailOpenPurgeCachedDocument(): void
215215
{
216-
$collection = __FUNCTION__;
216+
$collection = substr(__FUNCTION__, 4, 34);
217217
$database = $this->seedCacheFailOpenCollection($collection);
218218
$originalCache = $database->getCache();
219219

@@ -231,7 +231,7 @@ public function testCacheFailOpenPurgeCachedDocument(): void
231231

232232
public function testCacheFailOpenPurgeCachedCollection(): void
233233
{
234-
$collection = __FUNCTION__;
234+
$collection = substr(__FUNCTION__, 4, 34);
235235
$database = $this->seedCacheFailOpenCollection($collection);
236236
$originalCache = $database->getCache();
237237

@@ -249,7 +249,7 @@ public function testCacheFailOpenPurgeCachedCollection(): void
249249

250250
public function testCacheFailureEmitsPurgeFailureEvent(): void
251251
{
252-
$collection = __FUNCTION__;
252+
$collection = substr(__FUNCTION__, 4, 34);
253253
$database = $this->seedCacheFailOpenCollection($collection);
254254
$originalCache = $database->getCache();
255255

@@ -275,7 +275,7 @@ public function testCacheFailureEmitsPurgeFailureEvent(): void
275275

276276
public function testCacheReadFailureEmitsReadFailureEvent(): void
277277
{
278-
$collection = __FUNCTION__;
278+
$collection = substr(__FUNCTION__, 4, 34);
279279
$database = $this->seedCacheFailOpenCollection($collection);
280280
$originalCache = $database->getCache();
281281

@@ -307,7 +307,7 @@ public function testCacheReadFailureEmitsReadFailureEvent(): void
307307

308308
public function testThrowingCachePurgeFailureListenerDoesNotPropagate(): void
309309
{
310-
$collection = __FUNCTION__;
310+
$collection = substr(__FUNCTION__, 4, 34);
311311
$database = $this->seedCacheFailOpenCollection($collection);
312312
$originalCache = $database->getCache();
313313

@@ -336,7 +336,7 @@ public function testThrowingCachePurgeFailureListenerDoesNotPropagate(): void
336336

337337
public function testThrowingCacheReadFailureListenerDoesNotPropagate(): void
338338
{
339-
$collection = __FUNCTION__;
339+
$collection = substr(__FUNCTION__, 4, 34);
340340
$database = $this->seedCacheFailOpenCollection($collection);
341341
$originalCache = $database->getCache();
342342

@@ -360,7 +360,7 @@ public function testThrowingCacheReadFailureListenerDoesNotPropagate(): void
360360

361361
public function testThrowingDocumentPurgeListenerDoesNotPropagate(): void
362362
{
363-
$collection = __FUNCTION__;
363+
$collection = substr(__FUNCTION__, 4, 34);
364364
$database = $this->seedCacheFailOpenCollection($collection);
365365

366366
$database->on(Database::EVENT_DOCUMENT_PURGE, 'throwing-listener', function () {
@@ -379,7 +379,7 @@ public function testThrowingDocumentPurgeListenerDoesNotPropagate(): void
379379

380380
public function testUpdateDocumentPersistsDespiteBrokenCachePurge(): void
381381
{
382-
$collection = __FUNCTION__;
382+
$collection = substr(__FUNCTION__, 4, 34);
383383
$database = $this->seedCacheFailOpenCollection($collection);
384384
$originalCache = $database->getCache();
385385

@@ -407,7 +407,7 @@ public function testUpdateDocumentPersistsDespiteBrokenCachePurge(): void
407407

408408
public function testDeleteDocumentPersistsDespiteBrokenCachePurge(): void
409409
{
410-
$collection = __FUNCTION__;
410+
$collection = substr(__FUNCTION__, 4, 34);
411411
$database = $this->seedCacheFailOpenCollection($collection);
412412
$originalCache = $database->getCache();
413413

0 commit comments

Comments
 (0)