client = Utility::getClient(); if (!Utility::isOpenSearchVersionAtLeast($this->client, '2.4.0')) { $this->markTestSkipped('Point-in-time tests require OpenSearch >= 2.4.0'); } $this->client->create([ 'index' => self::INDEX, 'id' => 100, 'body' => [ 'title' => 'Remember the Titans', 'director' => 'Boaz Yakin', 'year' => 2000 ] ]); } protected function tearDown(): void { parent::tearDown(); $this->client->indices()->delete([ 'index' => self::INDEX, ]); } public function testCreatePointInTime() { // Act $result = $this->client->createPointInTime([ 'index' => self::INDEX, 'keep_alive' => '10m', ]); // Assert $this->assertNotEmpty($result['pit_id']); $this->assertGreaterThanOrEqual((time() - 1) * 1000, $result['creation_time']); $this->assertLessThan((time() + 10) * 1000, $result['creation_time']); } }