zeenix / gps-share

Utility to share your GPS device on local network
GNU General Public License v2.0
67 stars 9 forks source link

Use TCP port 10110 by default #10

Closed da2x closed 6 years ago

da2x commented 6 years ago

Standard nmea-0183 service port as registered with IANA.

Resolves issue #9.

zeenix commented 6 years ago

Good stuff but as you can see this breaks the test in CI so you'll need to also update the testcase for this.

da2x commented 6 years ago

The tests randomly pass/fail because. In my defense, they all passed when I submitted this.

The Linux kernel fails to release the TCP port lock on all interfaces after each test is run and before the next one is started. Previously, each test used different ports so this wasn’t ever an issue.

I’m uncertain about how to proceed here. If I remove test_stdin_gps_autoport_iface in favor of test_stdin_gps_with_port_iface then all tests pass (as only one will use the default port – requires fixing test test_stdin_gps_with_port_iface to actually use a specific port which seems like a bug in the existing test).

zeenix commented 6 years ago

hmm.. Can't we ensure that we release the port lock somehow?

da2x commented 6 years ago

Oh! Tests are run concurrently. That would explain the issue.

da2x commented 6 years ago

Tests can either be run with cargo test -- --test-threads=1 or I can change the tests to use different ports. I don’t see any other option. (Well, I could create virtual network interfaces and bind to those, but it changes the tests just as much as testing different ports.)

Which do you prefer, @zeenix?

zeenix commented 6 years ago

different ports is better. If the service works on one port, it really should work on another as well.

zeenix commented 6 years ago

Do you want me to merge this already and add the lost change myself?

da2x commented 6 years ago

I just forgot to push the second commit, sorry. :)

zeenix commented 6 years ago

No worries. Congratulations on becoming a valued contributor! :)

da2x commented 6 years ago

I’ve got a new Contributor badge and everything. 👍