Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sorting of config mocks acc to req timestamp #1352

Merged
merged 5 commits into from
Jan 14, 2024

Conversation

Sarthak160
Copy link
Member

@Sarthak160 Sarthak160 commented Jan 14, 2024

Related Issue

Closes: #1354 and #1353

Describe the changes you've made

  1. Generic mocks are not sorted based on the timestamp of the request to significantly improve accuracy of matching.
  2. Testcase Response is not recorded as soon as the server starts sending data.
  3. The Mock datastore now has sorting information to ensure that the mocks are matched according the timestamps.
  4. The mocks now also have an id to ensure correlation with the logs.
  5. We have made Postgres use ConfigMocks by default instead of TCS (Data mocks) since it's hard to pinpoint exact request related mock. This would be further improved in a future version.
  6. Extra Debug and info logs added for better visibility to debug future issues.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@slayerjain
Copy link
Member

@Sarthak160 is pkg/hooks/bpf_bpfel_arm64.o intentional or accidental ?

@Sarthak160
Copy link
Member Author

Sarthak160 commented Jan 14, 2024

@Sarthak160 is pkg/hooks/bpf_bpfel_arm64.o intentional or accidental ?

Intentional, Added some ebpf logs for req timestamp

@slayerjain
Copy link
Member

won't we need to do this for amd64 then too?

Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>
pkg/hooks/connection/tracker.go Outdated Show resolved Hide resolved
conn.logger.Debug("no response timestamp found, skipping recording")
recordTraffic = false
}
conn.logger.Debug(fmt.Sprintf("TestRequestTimestamp:%v || TestResponseTimestamp:%v", reqTimestampTest, resTimestampTest))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>
@slayerjain
Copy link
Member

LGTM!

@slayerjain slayerjain merged commit 1c13f97 into keploy:main Jan 14, 2024
13 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: Testcase response timestamps are incorrect
2 participants