Skip to content

Commit 6f4fe7d

Browse files
committed
Fix tests for MongoDB 7.0
Error message have changed Caused by :: Write conflict during plan execution and yielding is disabled. :: Please retry your operation or multi-document transaction.
1 parent af13eda commit 6f4fe7d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/build-ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ jobs:
4040
- '4.2'
4141
- '4.4'
4242
- '5.0'
43+
- '6.0'
44+
- '7.0'
4345
php:
4446
- '8.1'
4547
- '8.2'
4648
services:
4749
mysql:
48-
image: mysql:5.7
50+
image: mysql:8.0
4951
ports:
5052
- 3307:3306
5153
env:
@@ -58,13 +60,13 @@ jobs:
5860
- name: Create MongoDB Replica Set
5961
run: |
6062
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${{ matrix.mongodb }} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
61-
until docker exec --tty mongodb mongo 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
63+
until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
6264
sleep 1
6365
done
64-
sudo docker exec --tty mongodb mongo 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
66+
sudo docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
6567
- name: Show MongoDB server status
6668
run: |
67-
docker exec --tty mongodb mongo 127.0.0.1:27017 --eval "db.runCommand({ serverStatus: 1 })"
69+
docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ serverStatus: 1 })"
6870
- name: "Installing php"
6971
uses: shivammathur/setup-php@v2
7072
with:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG PHP_VERSION=8.1
2-
ARG COMPOSER_VERSION=2.5.4
2+
ARG COMPOSER_VERSION=2.5.8
33

44
FROM php:${PHP_VERSION}-cli
55

tests/TransactionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ public function testTransactionRespectsRepetitionLimit(): void
384384
$this->fail('Expected exception during transaction');
385385
} catch (BulkWriteException $e) {
386386
$this->assertInstanceOf(BulkWriteException::class, $e);
387-
$this->assertStringContainsString('WriteConflict', $e->getMessage());
388387
}
389388

390389
$this->assertSame(2, $timesRun);

0 commit comments

Comments
 (0)