View Issue Details

IDProjectCategoryView StatusLast Update
0005209Talermerchant backend API (C)public2017-12-10 15:19
ReporterFlorian DoldAssigned ToFlorian Dold 
PrioritylowSeverityminorReproducibilityhave not tried
Status feedbackResolutionopen 
Product VersionSVN HEAD 
Target VersionFixed in Version 
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 ;-)

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 View Revisions
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 => SVN HEAD
2017-12-10 15:19 Florian Dold Note Added: 0012651
2017-12-10 15:19 Florian Dold Priority normal => low