New issue
Advanced search Search tips

Issue 894676 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 12
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Flake in machinetoken tests

Project Member Reported by tandrii@chromium.org, Oct 12

Issue description

From https://logs.chromium.org/logs/infra/buildbucket/cr-buildbucket.appspot.com/8932912394437115136/+/steps/go_test/0/stdout
Build: https://ci.chromium.org/p/infra/builders/luci.infra.try/Luci-go%20Win%20Tester/b8932912394437115136
it's a tryjob, but CL doesn't touch tokenserver, so I think it's a flaky test.

  ...x....
  Failures:
    * e:/b/swarm_slave/w/ir/cache/infra_gclient_with_go/infra/go/src/go.chromium.org/luci/tokenserver/appengine/impl/machinetoken/rpc_inspect_machine_token_test.go 
    Line 72:
    Expected: '(*admin.InspectMachineTokenResponse){Valid:false, InvalidityReason:"bad signature - crypto/rsa: verification error", Signed:false, NonExpired:true, NonRevoked:true, SigningKeyId:"d05d42ed6308801ad58929ff5d0e85fd00de04bd", CertCaName:"Fake CA: fake.ca", TokenType:(*admin.InspectMachineTokenResponse_LuciMachineToken){LuciMachineToken:(*tokenserver.MachineTokenBody){MachineFqdn:"luci-token-server-test-1.fake.domain", IssuedBy:"signer@testing.host", IssuedAt:1422936306, Lifetime:3600, CaId:123, CertSn:4096, XXX_NoUnkeyedLiteral:struct {}{}, XXX_unrecognized:[]uint8(nil), XXX_sizecache:0}}, XXX_NoUnkeyedLiteral:struct {}{}, XXX_unrecognized:[]uint8(nil), XXX_sizecache:0}'
    Actual:   '(*admin.InspectMachineTokenResponse){Valid:true, InvalidityReason:"", Signed:true, NonExpired:true, NonRevoked:true, SigningKeyId:"d05d42ed6308801ad58929ff5d0e85fd00de04bd", CertCaName:"Fake CA: fake.ca", TokenType:(*admin.InspectMachineTokenResponse_LuciMachineToken){LuciMachineToken:(*tokenserver.MachineTokenBody){MachineFqdn:"luci-token-server-test-1.fake.domain", IssuedBy:"signer@testing.host", IssuedAt:1422936306, Lifetime:3600, CaId:123, CertSn:4096, XXX_NoUnkeyedLiteral:struct {}{}, XXX_unrecognized:[]uint8(nil), XXX_sizecache:0}}, XXX_NoUnkeyedLiteral:struct {}{}, XXX_unrecognized:[]uint8(nil), XXX_sizecache:0}'
    (Should resemble)!
  32 total assertions
  --- FAIL: TestInspectMachineTokenRPC (0.20s)
  ....
  36 total assertions
  ..
  38 total assertions
  FAIL
  FAIL	go.chromium.org/luci/tokenserver/appengine/impl/machinetoken	0.445s
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 12

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/1bbbd982903af9f7273b5862decd4d7a32c41076

commit 1bbbd982903af9f7273b5862decd4d7a32c41076
Author: Vadim Shtayura <vadimsh@chromium.org>
Date: Fri Oct 12 02:05:37 2018

[token-server] Fix flake in rpc_inspect_machine_token_test.go.

The test used to replace few bits of a token with zeros to make the signature
"broken".

Some time ago Go introduced randomization to the RSA private key generator
(used in the test) that can't be disabled. Thus the signature also became
random. And sometimes the bits being replaced by zeroes are actually already
zeros.

Replace much more bits with zeros. The chance of a flake is negligible now.

R=tandrii@chromium.org
BUG= 894676 

Change-Id: I35e6326413880eeaf0276951684ee3143ad7565a
Reviewed-on: https://chromium-review.googlesource.com/c/1277977
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Auto-Submit: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

[modify] https://crrev.com/1bbbd982903af9f7273b5862decd4d7a32c41076/tokenserver/appengine/impl/machinetoken/rpc_inspect_machine_token_test.go

Status: Fixed (was: Assigned)

Sign in to add a comment