View Issue Details

IDProjectCategoryView StatusLast Update
0005209Talermechant backendpublic2024-01-12 14:04
ReporterFlorian Dold Assigned ToFlorian Dold  
PrioritylowSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Product Versiongit (master) 
Target Version0.7.1Fixed in Version0.8 
Summary0005209: test cases should not use fixed port numbers
DescriptionFor example the merchant lib test uses port 8081, which clashes with some buildbot port.

We can also run into cases where two tests are executed simultaneously, with some bad luck one of them will fail.

We can find free ports e.g. with this method: https://www.dnorth.net/2012/03/17/the-port-0-trick/

The idea is to:
1) select a port that is currently free
2) start the exchange (or whatever component we need to run)
3) if it failed (because of a race on the port), try again with another port for some small number of tries

And on systems where it's not supported, we fall back to a fixed port number.
TagsNo tags attached.

Activities

Christian Grothoff

2017-12-10 15:11

manager   ~0012650

We actually have logic for picking free ports like that in GNUnet (testing subsystem uses it). But it's usually quite a bit of extra work to achieve this level of flexibility, especially as we would have to _write_ configuration files with those port numbers in them in many cases.

So for now, I think we should simply avoid conflicting port numbers on taler.net, maybe use more, eh, unusual ones, but consistently changing the test logic to pick free ports is really not worth the trouble.

Florian Dold

2017-12-10 15:19

manager   ~0012651

I've already changed the offending port, and now the tests work again.

Then let's not make the dynamic port selection a priority now, but eventually I'd like to have it, since when more people do something with the backend we'll hear about this again eventually ;-)

Florian Dold

2020-04-06 21:00

manager   ~0015537

I think this not relevant anymore, as we have the netjail now!

Issue History

Date Modified Username Field Change
2017-12-10 14:47 Florian Dold New Issue
2017-12-10 14:47 Florian Dold Status new => assigned
2017-12-10 14:47 Florian Dold Assigned To => Marcello Stanisci
2017-12-10 14:49 Florian Dold Description Updated
2017-12-10 14:49 Florian Dold Assigned To Marcello Stanisci => Christian Grothoff
2017-12-10 15:11 Christian Grothoff Note Added: 0012650
2017-12-10 15:11 Christian Grothoff Assigned To Christian Grothoff => Florian Dold
2017-12-10 15:11 Christian Grothoff Status assigned => feedback
2017-12-10 15:11 Christian Grothoff Product Version => git (master)
2017-12-10 15:19 Florian Dold Note Added: 0012651
2017-12-10 15:19 Florian Dold Priority normal => low
2020-04-06 21:00 Florian Dold Status feedback => resolved
2020-04-06 21:00 Florian Dold Resolution open => no change required
2020-04-06 21:00 Florian Dold Note Added: 0015537
2020-04-13 02:40 Christian Grothoff Target Version => 0.7.1
2020-07-24 11:56 Christian Grothoff Fixed in Version => 0.8
2021-08-24 16:23 Christian Grothoff Status resolved => closed
2024-01-12 14:04 Christian Grothoff Category merchant backend API (C) => mechant backend