This is the relevant test:

```
like_program_out 'postgres', 'pg_lsclusters -h | sort -k3', 0, 
qr/.*5434.*5435.*5440.*/s,
    'port of first cluster was successfully changed';

# Execute a command as a particular user, and check the exit code and output
# against a regular expression (merged stdout/stderr).
# Arguments: <user> <command> <expected exit code> <expected output re> 
[<description>]
sub like_program_out {
    my $outref;
    my $result = exec_as $_[0], $_[1], $outref;
    is $result, $_[2], $_[1] or fail_debug;
    like ($$outref, $_[3], (defined $_[4] ? $_[4] : "correct output of $_[1]")) 
or fail_debug;
}
```

This is the original output the test is parsing:

```
# sudo -u postgres pg_lsclusters -h
17 new1 5434 online postgres /var/lib/postgresql/17/new1 
/var/log/postgresql/postgresql-17-new1.log
17 new2 5440 online postgres /var/lib/postgresql/17/new2 
/var/log/postgresql/postgresql-17-new2.log
17 old  5435 online postgres /var/lib/postgresql/17/old  
/var/log/postgresql/postgresql-17-old.log
```

GNU coreutils will sort the output above with `| sort -k3` (sorting
based on the 3rd column - i.e., port numbers), resulting in:

```
17 new1 5434 online postgres /var/lib/postgresql/17/new1 
/var/log/postgresql/postgresql-17-new1.log
17 old  5435 online postgres /var/lib/postgresql/17/old  
/var/log/postgresql/postgresql-17-old.log
17 new2 5440 online postgres /var/lib/postgresql/17/new2 
/var/log/postgresql/postgresql-17-new2.log
```

which is the expected port order parsed by the regular expression in the
test.

uutils will sort the same output with `| sort -k3` with the following
output, as shown in the test logs:

```
17 old  5435 online postgres /var/lib/postgresql/17/old  
/var/log/postgresql/postgresql-17-old.log
17 new1 5434 online postgres /var/lib/postgresql/17/new1 
/var/log/postgresql/postgresql-17-new1.log
17 new2 5440 online postgres /var/lib/postgresql/17/new2 
/var/log/postgresql/postgresql-17-new2.log
```

which is not in the order expected by the test's regular expression,
leading to a test failure.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2125057

Title:
  the autopkgtest are failing with rust-coreutils

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-common/+bug/2125057/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to