Richard W.M. Jones
2023-May-31 09:12 UTC
[Libguestfs] [PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks
On Sat, May 27, 2023 at 03:32:36PM +0200, J?rgen H?tzel wrote:> Fixes failing implice_close test on OCaml 5. > --- > ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml > index 567e550b4..5e00c21ac 100644 > --- a/ocaml/t/guestfs_065_implicit_close.ml > +++ b/ocaml/t/guestfs_065_implicit_close.ml > @@ -30,8 +30,8 @@ let () > *) > > (* This should cause the GC to close the handle. *) > -let () = Gc.compact () > +let () = Gc.full_major () > > let () = assert (!close_invoked = 1) > > -let () = Gc.compact () > +let () = Gc.full_major ()I don't understand this patch at all. If there a test failing we need to diagnose why it is failing, not paper over the symptoms. What is the exact failure? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Laszlo Ersek
2023-May-31 10:32 UTC
[Libguestfs] [PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks
On 5/31/23 11:12, Richard W.M. Jones wrote:> On Sat, May 27, 2023 at 03:32:36PM +0200, J?rgen H?tzel wrote: >> Fixes failing implice_close test on OCaml 5. >> --- >> ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/ocaml/t/guestfs_065_implicit_close.ml b/ocaml/t/guestfs_065_implicit_close.ml >> index 567e550b4..5e00c21ac 100644 >> --- a/ocaml/t/guestfs_065_implicit_close.ml >> +++ b/ocaml/t/guestfs_065_implicit_close.ml >> @@ -30,8 +30,8 @@ let () >> *) >> >> (* This should cause the GC to close the handle. *) >> -let () = Gc.compact () >> +let () = Gc.full_major () >> >> let () = assert (!close_invoked = 1) >> >> -let () = Gc.compact () >> +let () = Gc.full_major () > > I don't understand this patch at all. If there a test failing we need > to diagnose why it is failing, not paper over the symptoms. > > What is the exact failure?Well my assumption is that (a) we need to force a garbage collection for the (unreachable) handle to be closed actually (from earlier, nothing new regarding that), but (b) with OCaml 5, "compact" is not strong enough for that, while "full_major" is. Whether that means OCaml 5 changed the semantics of these functions, or that even with OCaml 4 we've only (consistently) lucky with "compact", I can't tell. Laszlo