Skip to content

Commit

Permalink
daemon: fix racy tests caused by copy-pasted variable
Browse files Browse the repository at this point in the history
The test creates two symbolic links but reuses some information about them by
passing the same variable. Use the proper variable to avoid being sensitive to
symlink mtime differences on fast enough systems.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga authored and Meulengracht committed Jun 19, 2024
1 parent 59d9008 commit 64aee54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/api_snaps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ components:
InstallDate: snap.ComponentInstallDate(cpi, snap.R(7)), InstalledSize: 2},
{Name: "comp-2", Type: "test", Version: "1.0", Revision: snap.R(34),
Summary: "summary 2", Description: "description 2",
InstallDate: snap.ComponentInstallDate(cpi, snap.R(7)), InstalledSize: 3},
InstallDate: snap.ComponentInstallDate(cpi2, snap.R(7)), InstalledSize: 3},
{Name: "comp-3", Type: "test",
Summary: "summary 3", Description: "description 3"},
{Name: "comp-4", Type: "test"},
Expand Down

0 comments on commit 64aee54

Please sign in to comment.