Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 30, 2025

Input API tests were timing out due to dmlog_input_available() only checking the ring buffer, not the internal read buffer. When multiple chars were read at once, data moved to internal buffer but input_available returned false, causing infinite wait loops.

Changes

  • Fix dmlog_input_available(): Check both ring buffer and internal read buffer

    result = (ctx->ring.input_tail_offset != ctx->ring.input_head_offset) ||
             (ctx->input_read_entry_offset < DMOD_LOG_MAX_ENTRY_SIZE && 
              ctx->input_read_buffer[ctx->input_read_entry_offset] != '\0');
  • Implement Dmod_Stdin_SetFlags/Dmod_Stdin_GetFlags: Store flags in dmlog format internally, convert in get/set functions

    • DMOD_STDIN_FLAG_ECHO!DMLOG_INPUT_REQUEST_FLAG_ECHO_OFF
    • DMOD_STDIN_FLAG_CANONICALDMLOG_INPUT_REQUEST_FLAG_LINE_MODE
  • Simplify Dmod_Getc/Dmod_Gets: Use global flags directly without per-call conversion

  • Set CI test timeout: 10 minutes (was defaulting to 6h)

Original prompt

This section details on the original issue you should resolve

<issue_title>Naprawić failujace testy i dodać wsparcie dla flag stdin</issue_title>
<issue_description>Aktualnie testy z input failuja z timeoutem. Niestety domyślny timeout jest ustawiony na CI na 6h - ustaw go na 10 minut.

Napraw failujace testy i dodaj wsparcie dla nowych funkcji z dmod - Dmod_Stdin_SetFlags i Dmod_Stdin_GetFlags - niech one ustawiają jakaś zmienna globalna, której będziesz używać w dmod API dla getc i gets. </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 30, 2025
Copilot AI and others added 2 commits November 30, 2025 07:36
- Set CI test timeout to 10 minutes
- Fix dmlog_input_available to check internal buffer
- Implement Dmod_Stdin_SetFlags and Dmod_Stdin_GetFlags
- Update Dmod_Getc and Dmod_Gets to use global stdin flags
- Add tests for new stdin flags functionality

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
- Store flags in dmlog format (dmlog_input_request_flags_t)
- Convert DMOD_STDIN_FLAG_* to dmlog flags in Dmod_Stdin_SetFlags
- Convert dmlog flags to DMOD_STDIN_FLAG_* in Dmod_Stdin_GetFlags
- Simplify Dmod_Getc and Dmod_Gets to use flags directly

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing tests and add stdin flag support Fix failing input tests and add Dmod_Stdin_SetFlags/GetFlags support Nov 30, 2025
Copilot AI requested a review from JohnAmadis November 30, 2025 07:45
@JohnAmadis JohnAmadis marked this pull request as ready for review November 30, 2025 07:45
@JohnAmadis JohnAmadis merged commit 9003d6f into master Nov 30, 2025
6 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.

Naprawić failujace testy i dodać wsparcie dla flag stdin

2 participants