xpra icon
Bug tracker and wiki

Opened 19 months ago

Closed 2 months ago

#1773 closed task (fixed)

better unit tests for mixins

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 3.0
Component: core Version: 2.2.x
Keywords: Cc:

Description (last modified by Antoine Martin)

Follow up from #1761. See also #1778

We already have basic unit tests for client and server mixins:

  • r18558 server: mmap and remote logging
  • r18534 client: mmap and network state
  • r18535 client: remote logging

Only getting good test coverage will ensure that each mixin is independent from the others.

Change History (7)

comment:1 Changed 18 months ago by Antoine Martin

Description: modified (diff)
Status: newassigned

comment:2 Changed 2 months ago by Antoine Martin

  • r23106 adds an audio client mixin test, new issues to deal with:
    • duplication of self._remote_machine_id
    • python2 segfaults (meh)
    • first audio packets may come out of order! ('sound-data' before 'sound-control')
  • r23107 split test
  • r23108 adds a clipboard test, new issues:
    • run under X11 - needs to start a new display
    • verify clipboard state externally? (using xclip?)

comment:3 Changed 2 months ago by Antoine Martin

Added more client mixins tests - now mostly complete (just without rpc test):

Still TODO:

  • test multiple times with different options combinations / different server capabilities
  • test coverage
  • server mixins tests

comment:4 Changed 2 months ago by Antoine Martin

Server mixins tests:

  • r23120 refactoring + audio test
  • r23121 refactoring
  • r23122 child commands - needs _upgrading flag and session_name..
  • r23123 mixin test improvements for:
  • r23125 clipboard
  • r23126 display manager needs _server_sources
  • r23127 encoding
  • r23128 file-print
  • r23129 input needs _server_sources
  • r23131 network state
  • r23132 notification forwarder needs _server_sources
  • r23133 webcam
  • r23134 window server

New tasks:

  • source mixin tests
  • parse some network packets
  • control commands: split them up?
Last edited 2 months ago by Antoine Martin (previous) (diff)

comment:5 Changed 2 months ago by Antoine Martin

  • r23139 refactoring so we can test packets without an actual connection
  • r23140 re-order mixins init to make them more resilient
  • r23141 test sending audio packets. (audio mixin cannot assume that machine_id or uuid exist)
  • r23142 test starting a new command and then sending it a signal
  • r23143 encoding mixin - cannot assume that _idle_refresh_all_windows, send_windows and ui_client exist (heavy dependency on window mixin)
  • r23144 fixup file-print test
  • r23147 remote-logging packet test
  • r23149 fixes a huge bug in the ping / client-latency calculations
  • r23151 all network state packets - cannot assume we have statistics object
  • r23152 test notification packets
  • r23155 + r23157 move file-print and network-state packet handlers out of the UI thread
  • r23156 logging locking and cleanup

New tasks:

  • display, input and clipboard tests need to start their own display
  • file-print: needs to send chunks and verify file gets created
  • input test: could be used to test character sets and foreign keyboard layouts (hard!)
  • notification code needs to be moved to a source mixin

comment:6 Changed 2 months ago by Antoine Martin

Updates:

  • r23166 fixes a test error in the command-server test now that we pass a fake source mixin to the server mixin
  • r23167 + r23168: fix stop audio from client using sequence number, allowing:
  • r23169 audio client test made deterministic thanks to fixes above
  • r23170 audio server prevents spurious audio packets after stop request

Updated TODO:

  • audio needs test mp3 data to test receiving
  • verify all server source mixins have a server test
  • control commands
  • file-print: needs to send chunks and verify file gets created
  • many tests need to start an X11 display
  • test coverage: #2356
  • test multiple times with different options combinations / different server capabilities
  • combine client and server mixins in one test: #2357
  • input test: could be used to test character sets and foreign keyboard layouts (hard!)
  • notification code needs to be moved to a source mixin

comment:7 Changed 2 months ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Test updates:

Bugs found:

  • cython rectangle tests no longer fired after refactoring: r23224, r23225
  • fd leak bug: r23202
  • invalid command bug: r23204
  • clipboard: r23215
  • server startup failure handling: r23223
  • ssl test failures: r23226
  • python3 server socket upgrade failures: r23228 (+r23229 logging error)
  • win32 new monotonic_time code was wrong: r23233
  • don't allow invalid bandwidth limits: r23236

Will follow up in #2356, #2357 and #2362.

Note: See TracTickets for help on using tickets.