Skip to content

Fix serialization test bugs and enable Go 1.27 compat - #637

Merged
maxday merged 1 commit into
aws:mainfrom
djedward:main
Aug 27, 2026
Merged

Fix serialization test bugs and enable Go 1.27 compat#637
maxday merged 1 commit into
aws:mainfrom
djedward:main

Conversation

@djedward

@djedward djedward commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:
The tests fail to build for Go 1.27 due to changes in the JSON library:

It exposed an existing bug in how TestMalformedJson was being used. The method is a pass-through to json.Unmarshal which requires a pointer. Prior to 1.27, Go returned a SyntaxError, despite the issue being the target. I updated all the calls to properly pass a pointer and perform the check they were intending to check. I added tests for this function to make Codecov happy.

Secondly, the error message in Go 1.27 for the types has changed some. This updates the tests to be a little more flexible in their matching, allowing Go 1.27 and earlier versions to pass.

TestEnableSigterm appeared to be flaky and timing out, so used a polling mechanism, increased the timeouts and pre-pulled the image to see if that resolves the flakiness (seems to have finally passed every version).

TestConcurrencyWithRIE occasionally had failures (mainly due to taking too long "5.1s not less that 4.4"), so applied similar changes as TestEnableSigterm.

Those are optional changes and I'm happy to remove them (or feel free to edit the commit to remove them). I implemented them to help get the tests to pass.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter

codecov-commenter commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.02%. Comparing base (87e344b) to head (50a5783).

Files with missing lines Patch % Lines
lambda/extensions_api_client.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #637      +/-   ##
==========================================
+ Coverage   75.12%   77.02%   +1.90%     
==========================================
  Files          36       36              
  Lines        1419     1419              
==========================================
+ Hits         1066     1093      +27     
+ Misses        274      247      -27     
  Partials       79       79              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@djedward
djedward force-pushed the main branch 9 times, most recently from e22aedd to 279000c Compare August 6, 2026 14:06
@pieterocp

Copy link
Copy Markdown

suggestion: Expand the test runner matrix to include 1.27?

(prevent regression + prove this works with the latest version)

@djedward

Copy link
Copy Markdown
Contributor Author

When the PR was opened, it wasn't released, but it is now. I'll get it updated.

@djedward
djedward force-pushed the main branch 7 times, most recently from 6cbc567 to ea3d689 Compare August 25, 2026 16:49
@djedward

Copy link
Copy Markdown
Contributor Author

Ok, took a bit! Unrelated to this change, the golangci-lint action was broken because it uses the 'stable' version of Go, which is now Go 1.27, so patched that all up so it would pass.

  • Added Go 1.27 to the test matrix
  • Fixed linter warnings about the use of deadcode/varcheck in nolint directives. They are part of 'unused'.
  • Upgraded golangci-lint to latest version to match with Go 1.27 'stable'.
  • Added //nolint: govet to the use of the deprecated ioutil package which are now errors during linting (fixing would require dropping <=Go 1.15 support)
  • Fixing //nolint triggered code coverage issue, so I added some tests to events/tests, since they were touched. I did modify the functions to use the testing interface, allowing them to be properly mocked/tested. The interface is compatible with t.Testing, so callers did not need to be updated.

@maxday

maxday commented Aug 26, 2026

Copy link
Copy Markdown
Member

Thanks @djedward for fixing both of the flaky tests 💯

About the change, I think I'm fine with dropping 1.15 <= support (EOL Aug 16, 2021), what do you think @trivenay ? No a big fan of all of those linting exceptions.

Also could you bring back the shas in github actions? Dependabot understand them well, so it's fine to keep them, it's also in our policy to fix the action versions, thanks!

@djedward

Copy link
Copy Markdown
Contributor Author

Sounds good to me, I'll start with the hash locking so the versions don't upgrade. I would definitely be supportive of dropping <= 1.15, but I'll wait for consensus on that.

@trivenay

Copy link
Copy Markdown

Yes if someone wants to use the ric and they are using the deprecated version then they can use older ric versions -> This is the standard procedure we follow across all runtimes

trivenay
trivenay previously approved these changes Aug 26, 2026
@djedward

Copy link
Copy Markdown
Contributor Author

I've removed 1.13, 1.14 and 1.15 from the test matrix. I removed all the no longer necessary //nolint directives.

@maxday
maxday merged commit f0e2311 into aws:main Aug 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants