Skip Menu |

This queue is for tickets about the DBD-Firebird CPAN distribution.

Report information
The Basics
Id: 123623
Status: resolved
Priority: 0/
Queue: DBD-Firebird

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.25
Fixed in: 1.26



Subject: embed tests fail on debian/stretch
Most of the embed tests fail on my debian/stretch smoker: ... # Creating test database at dbd-firebird-test.fdb Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements -Unable to complete network request to host "localhost". -Failed to establish a connection. at /home/cpansand/.cpan/build/2017111406/DBD-Firebird-1.25-0/blib/lib/DBD/FirebirdEmbedded.pm line 125. t/embed-01-connect.t ............ Dubious, test returned 111 (wstat 28416, 0x6f00) No subtests run ...
На 14 ноем. 2017, вт 10:26:16, SREZIC написа: Show quoted text
> Most of the embed tests fail on my debian/stretch smoker: > > ... > # Creating test database at dbd-firebird-test.fdb > Unsuccessful execution caused by a system error that precludes > successful execution of subsequent statements > -Unable to complete network request to host "localhost". > -Failed to establish a connection. at > /home/cpansand/.cpan/build/2017111406/DBD-Firebird-1.25- > 0/blib/lib/DBD/FirebirdEmbedded.pm line 125.
Yeah. This is because for the embedded access to work with firebird 3, the embedded engine (libEngine12.s0) needs to be available. It is in the firebird3.0-server-core. An attempt to load it is made by libfbclient2 when direct-file access is made, and if that fails (when libEngine12.so is not found), the request is transformed to a TCP one to localhost, which rightfully fails, because there is no firebird server listening (and even if there were firebird server listening, the request would still fail, since the firebird server doesn't normaly have file-level access to the database file DBD-Firebird tries to access). You can workaround this in the smoker by installing firebird3.0-server-core. I am open to any ideas how to express this dependency in META, or how to test for it in MakeFile.PL, so that the tests are skipped.
On 2017-11-14 15:13:59, DAM wrote: Show quoted text
> На 14 ноем. 2017, вт 10:26:16, SREZIC написа:
> > Most of the embed tests fail on my debian/stretch smoker: > > > > ... > > # Creating test database at dbd-firebird-test.fdb > > Unsuccessful execution caused by a system error that precludes > > successful execution of subsequent statements > > -Unable to complete network request to host "localhost". > > -Failed to establish a connection. at > > /home/cpansand/.cpan/build/2017111406/DBD-Firebird-1.25- > > 0/blib/lib/DBD/FirebirdEmbedded.pm line 125.
> > Yeah. This is because for the embedded access to work with firebird 3, > the embedded engine (libEngine12.s0) needs to be available. It is in > the firebird3.0-server-core. An attempt to load it is made by > libfbclient2 when direct-file access is made, and if that fails (when > libEngine12.so is not found), the request is transformed to a TCP one > to localhost, which rightfully fails, because there is no firebird > server listening (and even if there were firebird server listening, > the request would still fail, since the firebird server doesn't > normaly have file-level access to the database file DBD-Firebird tries > to access). > > You can workaround this in the smoker by installing firebird3.0- > server-core. > > I am open to any ideas how to express this dependency in META, or how > to test for it in MakeFile.PL, so that the tests are skipped.
It is not possible to specify system-level dependencies in META. The solution for my smokers is the module CPAN::Plugin::Sysdeps (a CPAN plugin capable of installing system dependencies for CPAN modules), which I will change like this: diff --git a/lib/CPAN/Plugin/Sysdeps/Mapping.pm b/lib/CPAN/Plugin/Sysdeps/Mapping.pm index bc65958..7b056e9 100644 --- a/lib/CPAN/Plugin/Sysdeps/Mapping.pm +++ b/lib/CPAN/Plugin/Sysdeps/Mapping.pm @@ -692,7 +692,10 @@ sub mapping { [os_freebsd, [package => 'firebird25-server']], [like_debian, - [package => 'firebird-dev']], + [linuxdistrocodename => [qw(squeeze wheezy jessie precise trusty xenial)], + [package => 'firebird-dev']], + [package => [qw(firebird-dev firebird3.0-server-core)]] # for stretch (and newer?) + ], [like_fedora, [package => 'firebird-devel']], ], With this change the tests pass on the debian/stretch smoker. But! I found another problem: the tests seem to create the directory /tmp/firebird and a file fb_init in it. If the test is executed by different users on the same machine, then the 2nd one will see a failure. Probably it's better to use a directory name with a userid attached, or even better, a temporary directory created by File::Temp::tempdir. Regards, Slaven
On 2017-11-14 15:53:14, SREZIC wrote: Show quoted text
> On 2017-11-14 15:13:59, DAM wrote:
> > На 14 ноем. 2017, вт 10:26:16, SREZIC написа:
> > > Most of the embed tests fail on my debian/stretch smoker: > > > > > > ... > > > # Creating test database at dbd-firebird-test.fdb > > > Unsuccessful execution caused by a system error that precludes > > > successful execution of subsequent statements > > > -Unable to complete network request to host "localhost". > > > -Failed to establish a connection. at > > > /home/cpansand/.cpan/build/2017111406/DBD-Firebird-1.25- > > > 0/blib/lib/DBD/FirebirdEmbedded.pm line 125.
> > > > Yeah. This is because for the embedded access to work with firebird > > 3, > > the embedded engine (libEngine12.s0) needs to be available. It is in > > the firebird3.0-server-core. An attempt to load it is made by > > libfbclient2 when direct-file access is made, and if that fails (when > > libEngine12.so is not found), the request is transformed to a TCP one > > to localhost, which rightfully fails, because there is no firebird > > server listening (and even if there were firebird server listening, > > the request would still fail, since the firebird server doesn't > > normaly have file-level access to the database file DBD-Firebird > > tries > > to access). > > > > You can workaround this in the smoker by installing firebird3.0- > > server-core. > > > > I am open to any ideas how to express this dependency in META, or how > > to test for it in MakeFile.PL, so that the tests are skipped.
> > It is not possible to specify system-level dependencies in META. The > solution for my smokers is the module CPAN::Plugin::Sysdeps (a CPAN > plugin capable of installing system dependencies for CPAN modules), > which I will change like this: > > diff --git a/lib/CPAN/Plugin/Sysdeps/Mapping.pm > b/lib/CPAN/Plugin/Sysdeps/Mapping.pm > index bc65958..7b056e9 100644 > --- a/lib/CPAN/Plugin/Sysdeps/Mapping.pm > +++ b/lib/CPAN/Plugin/Sysdeps/Mapping.pm > @@ -692,7 +692,10 @@ sub mapping { > [os_freebsd, > [package => 'firebird25-server']], > [like_debian, > - [package => 'firebird-dev']], > + [linuxdistrocodename => [qw(squeeze wheezy jessie precise > trusty xenial)], > + [package => 'firebird-dev']], > + [package => [qw(firebird-dev firebird3.0-server-core)]] # for > stretch (and newer?) > + ], > [like_fedora, > [package => 'firebird-devel']], > ], > > > With this change the tests pass on the debian/stretch smoker. > > But! I found another problem: the tests seem to create the directory > /tmp/firebird and a file fb_init in it. If the test is executed by > different users on the same machine, then the 2nd one will see a > failure. Probably it's better to use a directory name with a userid > attached, or even better, a temporary directory created by > File::Temp::tempdir. >
Here's how the permission problem looks like: # Creating test database at dbd-firebird-test.fdb Unsuccessful execution caused by an unavailable resource. -Can not access lock files directory /tmp/firebird/ at /home/cpansand/.cpan/build/2017111418/DBD-Firebird-1.25-1/blib/lib/DBD/FirebirdEmbedded.pm line 125. t/embed-01-connect.t ............ Dubious, test returned 111 (wstat 28416, 0x6f00) No subtests run
На 14 ноем. 2017, вт 22:53:14, SREZIC написа: Show quoted text
> With this change the tests pass on the debian/stretch smoker. > > But! I found another problem: the tests seem to create the directory > /tmp/firebird and a file fb_init in it. If the test is executed by > different users on the same machine, then the 2nd one will see a > failure. Probably it's better to use a directory name with a userid > attached, or even better, a temporary directory created by > File::Temp::tempdir.
1.26 uses the later approach and should be fine.
Fixed in 1.26, where a temporary directory is used for temp database and firebird lock/init/etc files