Certain snapd tests don't take into account system locale differences

Bug #1960131 reported by Arseniy Aharonov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Low
Unassigned

Bug Description

The following tests fail if the host Linux is configured to certain locales (e.g. en_GB):

  - cmd_list_test.go:31: SnapSuite.TestListHelp
  - cmd_login_test.go:70: SnapSuite.TestLoginAskEmail
  - cmd_reboot_test.go:33: SnapSuite.TestRebootHelp
  - cmd_recovery_test.go:32: SnapSuite.TestRecoveryHelp
  - cmd_snapshot_test.go:79: SnapSuite.TestSnapSnaphotsTest
  - cmd_whoami_test.go:31: SnapSuite.TestWhoamiLoggedInUser
  - cmd_whoami_test.go:44: SnapSuite.TestWhoamiNotLoggedInUser

These tests capture STDOUT and compare the results to the expected strings. The tests assume that in all locales the captured output looks the same, which is not. That is why for most locales it will pass, but for some it will fail.

Current workaround is to set an environment variable `LANG` to value `C.UTF-8`. This sets a locale for which the aforementioned tests won't fail.

Tags: flaky-tests
Revision history for this message
Arseniy Aharonov (arsenique) wrote :

Once this issue gets fixed the HACKING.md of snapd repo should be updated (see https://github.com/snapcore/snapd/blob/master/HACKING.md). It's currently describes how to workaround this problem.

Changed in snapd:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Ian Johnson (anonymouse67) wrote :

Thanks for filing this bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.