From 91e75587fe54338b16b4ae594d1ba43a60142496 Mon Sep 17 00:00:00 2001 From: Jonathan Vollebregt Date: Fri, 10 Nov 2023 16:05:47 +0100 Subject: [PATCH] fixup! MicrotimeRepresentationTest: Memory is more accurate since 7.1 --- .../Zval/Representation/MicrotimeRepresentationTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Zval/Representation/MicrotimeRepresentationTest.php b/tests/Zval/Representation/MicrotimeRepresentationTest.php index b99c39142..714c02ed0 100644 --- a/tests/Zval/Representation/MicrotimeRepresentationTest.php +++ b/tests/Zval/Representation/MicrotimeRepresentationTest.php @@ -42,9 +42,6 @@ public function testConstruct() { $r = new MicrotimeRepresentation(123, 456, 7, 8, 100); - $mem = \memory_get_usage(); - $mem_peak = \memory_get_peak_usage(); - $this->assertSame(123, $r->seconds); $this->assertSame(456, $r->microseconds); $this->assertSame(7, $r->group); @@ -57,8 +54,12 @@ public function testConstruct() $this->assertSame(5, $r->i); $this->assertSame(20.0, $r->avg); + $mem = \memory_get_usage(); + $mem_peak = \memory_get_peak_usage(); + // Memory usage isn't going to be identical after making the representation - $this->assertLessThan(512, \abs($mem - $r->mem)); + // $this->assertLessThan(512, \abs($mem - $r->mem)); + $this->assertSame($mem, $r->mem); $this->assertSame($mem_peak, $r->mem_peak); }