8000 `TestSignedDatabaseSignatureIsRefreshed` is a flaky test · Issue #156 · anatol/pacoloco · GitHub
[go: up one dir, main page]

Skip to content

TestSignedDatabaseSignatureIsRefreshed is a flaky test #156

Open

Description

@wfdewith

Running go test -run TestSignedDatabaseSignatureIsRefreshed -count=100 makes it fail every now and then.

--- FAIL: TestSignedDatabaseSignatureIsRefreshed (0.00s)
    downloader_test.go:566:
        	Error Trace:	/home/wf/dev/oss/pacoloco/downloader_test.go:566
        	Error:      	Not equal:
        	            	expected: "fresh signature"
        	            	actual  : "stale signature"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-fresh signature
        	            	+stale signature
        	Test:       	TestSignedDatabaseSignatureIsRefreshed
        	Messages:   	the cached signature must be updated

This happens because the application might not have finished writing the signature when the test reads it here:

onDisk, err := os.ReadFile(cachedSig)

In theory, TestPrefetchAndClientDoNotShareDownloader has the same problem, but in practice it doesn't trigger because the download has an explicit 50 ms delay added.

Activity

  1. wfdewith commented on Aug 18, 2026

    @wfdewith
    Author

    #151 introduced this test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0